Polly 22.0.0git
isl_ast_build_expr.c File Reference
#include <isl/id.h>
#include <isl/space.h>
#include <isl/constraint.h>
#include <isl/ilp.h>
#include <isl/val.h>
#include <isl_ast_build_expr.h>
#include <isl_ast_private.h>
#include <isl_ast_build_private.h>
#include <isl_sort.h>

Go to the source code of this file.

Classes

struct  isl_ast_add_term_data
struct  isl_extract_mod_data
struct  isl_ast_extract_rational_data
struct  isl_ast_add_terms_data
struct  isl_ast_coefficients_of_sign_data
struct  isl_from_pw_aff_piece
struct  isl_from_pw_aff_data

Enumerations

enum  isl_from_pw_aff_state { isl_state_none , isl_state_single , isl_state_min , isl_state_max }

Functions

static __isl_give isl_affoppose_div_arg (__isl_take isl_aff *aff, __isl_take isl_val *d)
static isl_bool is_non_neg_after_stealing (__isl_keep isl_aff *aff, __isl_keep isl_val *d, struct isl_ast_add_term_data *data)
static __isl_give isl_affsteal_from_cst (__isl_take isl_aff *aff, __isl_keep isl_val *d, struct isl_ast_add_term_data *data)
static __isl_give isl_ast_exprdiv_mod (enum isl_ast_expr_op_type type, __isl_take isl_aff *aff, __isl_take isl_val *v, __isl_keep isl_ast_build *build)
static __isl_give isl_ast_exprvar_div (struct isl_ast_add_term_data *data, int pos)
static __isl_give isl_ast_exprvar (struct isl_ast_add_term_data *data, enum isl_dim_type type, int pos)
static isl_bool ast_expr_is_zero (__isl_keep isl_ast_expr *expr)
static __isl_give isl_ast_exprast_expr_add (__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2)
static __isl_give isl_ast_exprast_expr_sub (__isl_take isl_ast_expr *expr1, __isl_take isl_ast_expr *expr2)
static __isl_give isl_ast_exprisl_ast_expr_mod (__isl_keep isl_val *v, __isl_keep isl_aff *aff, __isl_keep isl_val *d, __isl_keep isl_ast_build *build)
static __isl_give isl_ast_exprscale (__isl_take isl_ast_expr *expr, __isl_take isl_val *v)
static __isl_give isl_ast_exprisl_ast_expr_add_term (__isl_take isl_ast_expr *expr, enum isl_dim_type type, int pos, __isl_take isl_val *v, struct isl_ast_add_term_data *data)
static __isl_give isl_ast_exprisl_ast_expr_add_int (__isl_take isl_ast_expr *expr, __isl_take isl_val *v)
static isl_bool is_even_test (struct isl_extract_mod_data *data, __isl_keep isl_aff *arg)
static isl_stat extract_term_and_mod (struct isl_extract_mod_data *data, __isl_take isl_aff *term, __isl_take isl_aff *arg)
static isl_stat extract_mod (struct isl_extract_mod_data *data)
static isl_stat extract_nonneg_mod (struct isl_extract_mod_data *data)
static int mod_constraint_is_simpler (struct isl_extract_mod_data *data, __isl_keep isl_constraint *c)
static isl_stat check_parallel_or_opposite (__isl_take isl_constraint *c, void *user)
static isl_stat try_extract_mod (struct isl_extract_mod_data *data)
static int extract_modulo (struct isl_extract_mod_data *data)
static __isl_give isl_affextract_modulos (__isl_take isl_aff *aff, __isl_keep isl_ast_expr **pos, __isl_keep isl_ast_expr **neg, __isl_keep isl_ast_build *build)
static isl_bool every_non_zero_coefficient (__isl_keep isl_aff *aff, int reverse, isl_bool(*fn)(enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user), void *user)
static isl_bool add_rational (enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user)
static __isl_give isl_affextract_rational (__isl_take isl_aff *aff, __isl_keep isl_ast_expr **expr, __isl_keep isl_ast_build *build)
static isl_bool add_term (enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user)
static __isl_give isl_ast_expradd_terms (__isl_take isl_ast_expr *expr, __isl_keep isl_aff *aff, struct isl_ast_add_term_data *data)
__isl_give isl_ast_exprisl_ast_expr_from_aff (__isl_take isl_aff *aff, __isl_keep isl_ast_build *build)
static isl_bool clear_opposite_sign (enum isl_dim_type type, int pos, __isl_take isl_val *v, void *user)
static __isl_give isl_affcoefficients_of_sign (__isl_take isl_aff *aff, int sign)
static isl_bool constant_is_considered_positive (__isl_keep isl_val *v, __isl_keep isl_ast_expr *pos, __isl_keep isl_ast_expr *neg)
static isl_bool is_stride_constraint (__isl_keep isl_aff *aff, int pos)
static isl_bool all_negative_coefficients (__isl_keep isl_aff *aff)
static __isl_give isl_ast_exprextract_stride_constraint (__isl_take isl_aff *aff, int pos, __isl_keep isl_ast_build *build)
static __isl_give isl_ast_exprconstruct_constraint_expr (int eq, __isl_take isl_ast_expr *expr_pos, __isl_take isl_ast_expr *expr_neg)
static __isl_give isl_ast_exprisl_ast_expr_from_constraint_no_stride (int eq, __isl_take isl_aff *aff, __isl_keep isl_ast_build *build)
static __isl_give isl_ast_exprisl_ast_expr_from_constraint (__isl_take isl_constraint *constraint, __isl_keep isl_ast_build *build)
static int cmp_constraint (__isl_keep isl_constraint *a, __isl_keep isl_constraint *b, void *user)
__isl_give isl_ast_exprisl_ast_build_expr_from_basic_set (__isl_keep isl_ast_build *build, __isl_take isl_basic_set *bset)
__isl_give isl_ast_exprisl_ast_build_expr_from_set_internal (__isl_keep isl_ast_build *build, __isl_take isl_set *set)
__isl_give isl_ast_exprisl_ast_build_expr_from_set (__isl_keep isl_ast_build *build, __isl_take isl_set *set)
static isl_stat isl_from_pw_aff_data_init (struct isl_from_pw_aff_data *data, __isl_keep isl_ast_build *build, __isl_keep isl_pw_aff *pa)
static void isl_from_pw_aff_data_clear (struct isl_from_pw_aff_data *data)
static void set_none (struct isl_from_pw_aff_data *data)
static void set_single (struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff)
static isl_stat extend_min (struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff)
static isl_stat extend_max (struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff)
static isl_stat extend_domain (struct isl_from_pw_aff_data *data, __isl_take isl_set *set, __isl_take isl_aff *aff, int replace)
static __isl_give isl_ast_exprast_expr_from_aff_list (__isl_take isl_aff_list *list, enum isl_from_pw_aff_state state, __isl_keep isl_ast_build *build)
static isl_ast_expr_list ** add_intermediate_piece (struct isl_from_pw_aff_data *data, int pos, isl_ast_expr_list **next)
static isl_stat add_last_piece (struct isl_from_pw_aff_data *data, int pos, isl_ast_expr_list **next)
static int sort_pieces_cmp (const void *p1, const void *p2, void *arg)
static isl_ast_exprbuild_pieces (struct isl_from_pw_aff_data *data)
static isl_bool single_is_subset (struct isl_from_pw_aff_data *data, __isl_keep isl_set *set)
static isl_bool aff_is_rational (__isl_keep isl_aff *aff)
static isl_bool is_single_rational_aff (__isl_keep isl_aff_list *list)
static isl_bool extends (struct isl_from_pw_aff_data *data, __isl_keep isl_set *set, __isl_keep isl_aff *aff, __isl_give isl_basic_set *(*test)(__isl_take isl_aff *aff1, __isl_take isl_aff *aff2))
static isl_bool extends_min (struct isl_from_pw_aff_data *data, __isl_keep isl_set *set, __isl_keep isl_aff *aff)
static isl_bool extends_max (struct isl_from_pw_aff_data *data, __isl_keep isl_set *set, __isl_keep isl_aff *aff)
static isl_stat ast_expr_from_pw_aff (__isl_take isl_set *set, __isl_take isl_aff *aff, void *user)
__isl_give isl_ast_exprisl_ast_build_expr_from_pw_aff_internal (__isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa)
__isl_give isl_ast_exprisl_ast_build_expr_from_pw_aff (__isl_keep isl_ast_build *build, __isl_take isl_pw_aff *pa)
static __isl_give isl_multi_pw_affset_iterator_names (__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa)
static __isl_give isl_ast_exprisl_ast_build_with_arguments (__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_ast_expr *arg0, __isl_take isl_multi_pw_aff *mpa)
static __isl_give isl_ast_exprisl_ast_build_from_multi_pw_aff_internal (__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_multi_pw_aff *mpa)
static __isl_give isl_ast_exprisl_ast_build_from_multi_pw_aff_member (__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa)
static __isl_give isl_ast_exprisl_ast_build_from_pw_multi_aff_internal (__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_pw_multi_aff *pma)
static __isl_give isl_ast_exprisl_ast_build_from_multi_pw_aff (__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_multi_pw_aff *mpa)
__isl_give isl_ast_exprisl_ast_build_call_from_multi_pw_aff (__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa)
__isl_give isl_ast_exprisl_ast_build_access_from_multi_pw_aff (__isl_keep isl_ast_build *build, __isl_take isl_multi_pw_aff *mpa)
static __isl_give isl_ast_exprisl_ast_build_from_pw_multi_aff (__isl_keep isl_ast_build *build, enum isl_ast_expr_op_type type, __isl_take isl_pw_multi_aff *pma)
__isl_give isl_ast_exprisl_ast_build_call_from_pw_multi_aff (__isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma)
__isl_give isl_ast_exprisl_ast_build_access_from_pw_multi_aff (__isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma)
__isl_give isl_ast_nodeisl_ast_build_call_from_executed (__isl_keep isl_ast_build *build, __isl_take isl_map *executed)

Enumeration Type Documentation

◆ isl_from_pw_aff_state

Enumerator
isl_state_none 
isl_state_single 
isl_state_min 
isl_state_max 

Definition at line 1826 of file isl_ast_build_expr.c.

Function Documentation

◆ add_intermediate_piece()

◆ add_last_piece()

◆ add_rational()

◆ add_term()

isl_bool add_term ( enum isl_dim_type type,
int pos,
__isl_take isl_val * v,
void * user )
static

◆ add_terms()

◆ aff_is_rational()

isl_bool aff_is_rational ( __isl_keep isl_aff * aff)
static

◆ all_negative_coefficients()

◆ ast_expr_add()

◆ ast_expr_from_aff_list()

◆ ast_expr_from_pw_aff()

◆ ast_expr_is_zero()

◆ ast_expr_sub()

◆ build_pieces()

◆ check_parallel_or_opposite()

◆ clear_opposite_sign()

◆ cmp_constraint()

◆ coefficients_of_sign()

◆ constant_is_considered_positive()

isl_bool constant_is_considered_positive ( __isl_keep isl_val * v,
__isl_keep isl_ast_expr * pos,
__isl_keep isl_ast_expr * neg )
static

◆ construct_constraint_expr()

◆ div_mod()

◆ every_non_zero_coefficient()

◆ extend_domain()

◆ extend_max()

◆ extend_min()

◆ extends()

◆ extends_max()

isl_bool extends_max ( struct isl_from_pw_aff_data * data,
__isl_keep isl_set * set,
__isl_keep isl_aff * aff )
static

Definition at line 2357 of file isl_ast_build_expr.c.

References __isl_keep, aff, extends(), isl_aff_le_basic_set(), isl_set, and set.

Referenced by ast_expr_from_pw_aff().

◆ extends_min()

isl_bool extends_min ( struct isl_from_pw_aff_data * data,
__isl_keep isl_set * set,
__isl_keep isl_aff * aff )
static

Definition at line 2344 of file isl_ast_build_expr.c.

References __isl_keep, aff, extends(), isl_aff_ge_basic_set(), isl_set, and set.

Referenced by ast_expr_from_pw_aff().

◆ extract_mod()

isl_stat extract_mod ( struct isl_extract_mod_data * data)
static

◆ extract_modulo()

◆ extract_modulos()

◆ extract_nonneg_mod()

◆ extract_rational()

◆ extract_stride_constraint()

◆ extract_term_and_mod()

◆ is_even_test()

isl_bool is_even_test ( struct isl_extract_mod_data * data,
__isl_keep isl_aff * arg )
static

◆ is_non_neg_after_stealing()

◆ is_single_rational_aff()

isl_bool is_single_rational_aff ( __isl_keep isl_aff_list * list)
static

Definition at line 2239 of file isl_ast_build_expr.c.

References __isl_keep, aff, aff_is_rational(), isl_aff_free(), isl_bool_error, isl_bool_false, and n.

Referenced by extends().

◆ is_stride_constraint()

◆ isl_ast_build_access_from_multi_pw_aff()

◆ isl_ast_build_access_from_pw_multi_aff()

◆ isl_ast_build_call_from_executed()

◆ isl_ast_build_call_from_multi_pw_aff()

◆ isl_ast_build_call_from_pw_multi_aff()

◆ isl_ast_build_expr_from_basic_set()

◆ isl_ast_build_expr_from_pw_aff()

◆ isl_ast_build_expr_from_pw_aff_internal()

◆ isl_ast_build_expr_from_set()

◆ isl_ast_build_expr_from_set_internal()

◆ isl_ast_build_from_multi_pw_aff()

◆ isl_ast_build_from_multi_pw_aff_internal()

◆ isl_ast_build_from_multi_pw_aff_member()

◆ isl_ast_build_from_pw_multi_aff()

◆ isl_ast_build_from_pw_multi_aff_internal()

◆ isl_ast_build_with_arguments()

◆ isl_ast_expr_add_int()

◆ isl_ast_expr_add_term()

◆ isl_ast_expr_from_aff()

◆ isl_ast_expr_from_constraint()

◆ isl_ast_expr_from_constraint_no_stride()

◆ isl_ast_expr_mod()

◆ isl_from_pw_aff_data_clear()

◆ isl_from_pw_aff_data_init()

◆ mod_constraint_is_simpler()

◆ oppose_div_arg()

◆ scale()

◆ set_iterator_names()

◆ set_none()

◆ set_single()

◆ single_is_subset()

◆ sort_pieces_cmp()

int sort_pieces_cmp ( const void * p1,
const void * p2,
void * arg )
static

Definition at line 2130 of file isl_ast_build_expr.c.

References arg, isl_set_n_basic_set(), and isl_from_pw_aff_piece::set.

Referenced by build_pieces().

◆ steal_from_cst()

◆ try_extract_mod()

◆ var()

__isl_give isl_ast_expr * var ( struct isl_ast_add_term_data * data,
enum isl_dim_type type,
int pos )
static

Definition at line 252 of file isl_ast_build_expr.c.

References __isl_give, isl_ast_add_term_data::build, id, isl_ast_build_get_iterator_id(), isl_ast_expr_from_id(), isl_die, isl_dim_div, isl_dim_set, isl_error_internal, isl_local_space_get_ctx(), isl_local_space_get_dim_id(), isl_local_space_has_dim_id(), isl_ast_add_term_data::ls, pos(), type, and var_div().

Referenced by at_least_one(), at_least_zero(), best_split(), check_lexpos(), check_table(), close_row(), con_is_redundant(), cut_to_hyperplane(), cut_to_integer_lexmin(), detect_constant_with_tmp(), drop_col(), find_pivot(), first_non_integer_row(), get_constant(), get_rounded_sample_value(), is_constant(), isl_ast_expr_add_term(), isl_poly_alloc_rec(), isl_tab_add_eq(), isl_tab_add_valid_eq(), isl_tab_cone_is_bounded(), isl_tab_detect_implicit_equalities(), isl_tab_detect_redundant(), isl_tab_extend_vars(), isl_tab_freeze_constraint(), isl_tab_is_constant(), isl_tab_mark_redundant(), isl_tab_min(), isl_tab_min_at_most_neg_one(), isl_tab_pivot(), isl_tab_push_var(), isl_tab_relax(), isl_tab_restore_redundant(), isl_tab_shift_var(), isl_tab_sign_of_max(), isl_tab_swap_constraints(), isl_tab_unrestrict(), map_bound_pw_aff(), max_is_manifestly_unbounded(), min_is_manifestly_unbounded(), next_non_integer_var(), perform_undo_var(), pivot_row(), print_base(), print_pow(), reached(), restore_basis(), restore_last_redundant(), restore_row(), rotate_constraints(), select_marked(), select_minimum(), set_minimum(), set_minimum_pa(), SF(), sign_of_max(), sign_of_min(), tab_detect_nonnegative_parameters(), to_col(), to_row(), unrelax(), ununrestrict(), update_index1(), update_index2(), var_reaches(), variable_free(), variable_new(), and vars_drop().

◆ var_div()