llvm-project/polly/lib/External/isl/isl_ast_private.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

123 lines
3.0 KiB
C
Raw Normal View History

#ifndef ISL_AST_PRIVATE_H
#define ISL_AST_PRIVATE_H
#include <isl/aff.h>
#include <isl/ast.h>
#include <isl/set.h>
#include <isl/map.h>
#include <isl/vec.h>
#include <isl/list.h>
/* An expression is either an integer, an identifier or an operation
* with zero or more arguments.
*/
struct isl_ast_expr {
int ref;
isl_ctx *ctx;
enum isl_ast_expr_type type;
union {
isl_val *v;
isl_id *id;
struct {
[Polly] Update ISL to isl-0.22.1-87-gfee05a13. The primary motivation is to fix an assertion failure in isl_basic_map_alloc_equality: isl_assert(ctx, room_for_con(bmap, 1), return -1); Although the assertion does not occur anymore, I could not identify which of ISL's commits fixed it. Compared to the previous ISL version, Polly requires some changes for this update * Since ISL commit 20d3574 "perform parameter alignment by modifying both arguments to function" isl_*_gist_* and similar functions do not always align the paramter list anymore. This caused the parameter lists in JScop files to become out-of-sync. Since many regression tests use JScop files with a fixed parameter list and order, we explicitly call align_params to ensure a predictable parameter list. * ISL changed some return types to isl_size, a typedef of (signed) int. This caused some issues where the return type was unsigned int before: - No overload for std::max(unsigned,isl_size) - It cause additional 'mixed signed/unsigned comparison' warnings. Since they do not break compilation, and sizes larger than 2^31 were never supported, I am going to fix it separately. * With the change to isl_size, commit 57d547 "isl_*_list_size: return isl_size" also changed the return value in case of an error from 0 to -1. This caused undefined looping over isl_iterator since the 'end iterator' got index -1, never reached from the 'begin iterator' with index 0. * Some internal changes in ISL caused the number of operations to increase when determining access ranges to determine aliasing overlaps. In one test, this caused exceeding the default limit of 800000. The operations-limit was disabled for this test.
2020-02-11 04:51:33 +08:00
enum isl_ast_expr_op_type op;
unsigned n_arg;
isl_ast_expr **args;
} op;
} u;
};
#undef EL
#define EL isl_ast_expr
#include <isl_list_templ.h>
__isl_give isl_ast_expr *isl_ast_expr_alloc_int_si(isl_ctx *ctx, int i);
__isl_give isl_ast_expr *isl_ast_expr_alloc_op(isl_ctx *ctx,
[Polly] Update ISL to isl-0.22.1-87-gfee05a13. The primary motivation is to fix an assertion failure in isl_basic_map_alloc_equality: isl_assert(ctx, room_for_con(bmap, 1), return -1); Although the assertion does not occur anymore, I could not identify which of ISL's commits fixed it. Compared to the previous ISL version, Polly requires some changes for this update * Since ISL commit 20d3574 "perform parameter alignment by modifying both arguments to function" isl_*_gist_* and similar functions do not always align the paramter list anymore. This caused the parameter lists in JScop files to become out-of-sync. Since many regression tests use JScop files with a fixed parameter list and order, we explicitly call align_params to ensure a predictable parameter list. * ISL changed some return types to isl_size, a typedef of (signed) int. This caused some issues where the return type was unsigned int before: - No overload for std::max(unsigned,isl_size) - It cause additional 'mixed signed/unsigned comparison' warnings. Since they do not break compilation, and sizes larger than 2^31 were never supported, I am going to fix it separately. * With the change to isl_size, commit 57d547 "isl_*_list_size: return isl_size" also changed the return value in case of an error from 0 to -1. This caused undefined looping over isl_iterator since the 'end iterator' got index -1, never reached from the 'begin iterator' with index 0. * Some internal changes in ISL caused the number of operations to increase when determining access ranges to determine aliasing overlaps. In one test, this caused exceeding the default limit of 800000. The operations-limit was disabled for this test.
2020-02-11 04:51:33 +08:00
enum isl_ast_expr_op_type op, int n_arg);
__isl_give isl_ast_expr *isl_ast_expr_alloc_binary(
enum isl_ast_expr_op_type type,
__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2);
#undef EL
#define EL isl_ast_node
#include <isl_list_templ.h>
/* A node is either a block, an if, a for, a user node or a mark node.
* "else_node" is NULL if the if node does not have an else branch.
* "cond" and "inc" are NULL for degenerate for nodes.
* In case of a mark node, "mark" is the mark and "node" is the marked node.
*/
struct isl_ast_node {
int ref;
isl_ctx *ctx;
enum isl_ast_node_type type;
union {
struct {
isl_ast_node_list *children;
} b;
struct {
isl_ast_expr *guard;
isl_ast_node *then;
isl_ast_node *else_node;
} i;
struct {
unsigned degenerate : 1;
isl_ast_expr *iterator;
isl_ast_expr *init;
isl_ast_expr *cond;
isl_ast_expr *inc;
isl_ast_node *body;
} f;
struct {
isl_ast_expr *expr;
} e;
struct {
isl_id *mark;
isl_ast_node *node;
} m;
} u;
isl_id *annotation;
};
__isl_give isl_ast_node *isl_ast_node_alloc_for(__isl_take isl_id *id);
__isl_give isl_ast_node *isl_ast_node_for_mark_degenerate(
__isl_take isl_ast_node *node);
__isl_give isl_ast_node *isl_ast_node_alloc_if(__isl_take isl_ast_expr *guard);
__isl_give isl_ast_node *isl_ast_node_alloc_block(
__isl_take isl_ast_node_list *list);
__isl_give isl_ast_node *isl_ast_node_alloc_mark(__isl_take isl_id *id,
__isl_take isl_ast_node *node);
__isl_give isl_ast_node *isl_ast_node_from_ast_node_list(
__isl_take isl_ast_node_list *list);
__isl_give isl_ast_node *isl_ast_node_for_set_body(
__isl_take isl_ast_node *node, __isl_take isl_ast_node *body);
__isl_give isl_ast_node *isl_ast_node_if_set_then(
__isl_take isl_ast_node *node, __isl_take isl_ast_node *child);
struct isl_ast_print_options {
int ref;
isl_ctx *ctx;
__isl_give isl_printer *(*print_for)(__isl_take isl_printer *p,
__isl_take isl_ast_print_options *options,
__isl_keep isl_ast_node *node, void *user);
void *print_for_user;
__isl_give isl_printer *(*print_user)(__isl_take isl_printer *p,
__isl_take isl_ast_print_options *options,
__isl_keep isl_ast_node *node, void *user);
void *print_user_user;
};
__isl_give isl_printer *isl_ast_node_list_print(
__isl_keep isl_ast_node_list *list, __isl_take isl_printer *p,
__isl_keep isl_ast_print_options *options);
#endif