add isl_aff_mod_val
[platform/upstream/isl.git] / isl_ast_build_private.h
index 0ee88c5..52133ab 100644 (file)
@@ -98,11 +98,24 @@ enum isl_ast_build_domain_type {
  * an element of the domain.  Each of these nodes is a user node
  * with as expression a call expression.
  *
+ * The "before_each_for" callback is called on each for node before
+ * its children have been created.
+ *
+ * The "after_each_for" callback is called on each for node after
+ * its children have been created.
+ *
  * "executed" contains the inverse schedule at this point
  * of the AST generation.
  * It is currently only used in isl_ast_build_get_schedule, which is
  * in turn only used by user code from within a callback.
  * The value is set right before we may be calling such a callback.
+ *
+ * "single_valued" is set if the current inverse schedule (which may or may
+ * not be stored in "executed") is known to be single valued, specifically
+ * an inverse schedule that was not (appeared not to be) single valued
+ * is extended to a single valued inverse schedule.  This is mainly used
+ * to avoid an infinite recursion when we fail to detect later on that
+ * the extended inverse schedule is single valued.
  */
 struct isl_ast_build {
        int ref;
@@ -131,11 +144,20 @@ struct isl_ast_build {
                __isl_keep isl_ast_build *build, void *user);
        void *at_each_domain_user;
 
+       __isl_give isl_id *(*before_each_for)(
+               __isl_keep isl_ast_build *context, void *user);
+       void *before_each_for_user;
+       __isl_give isl_ast_node *(*after_each_for)(
+               __isl_take isl_ast_node *node,
+               __isl_keep isl_ast_build *context, void *user);
+       void *after_each_for_user;
+
        __isl_give isl_ast_node *(*create_leaf)(
                __isl_take isl_ast_build *build, void *user);
        void *create_leaf_user;
 
        isl_union_map *executed;
+       int single_valued;
 };
 
 __isl_give isl_ast_build *isl_ast_build_clear_local_info(
@@ -165,6 +187,8 @@ __isl_give isl_ast_build *isl_ast_build_include_stride(
 __isl_give isl_ast_build *isl_ast_build_set_executed(
        __isl_take isl_ast_build *build,
        __isl_take isl_union_map *executed);
+__isl_give isl_ast_build *isl_ast_build_set_single_valued(
+       __isl_take isl_ast_build *build, int sv);
 __isl_give isl_set *isl_ast_build_get_domain(
        __isl_keep isl_ast_build *build);
 __isl_give isl_ast_build *isl_ast_build_restrict_generated(
@@ -197,6 +221,9 @@ __isl_give isl_pw_aff *isl_ast_build_compute_gist_pw_aff(
 __isl_give isl_pw_multi_aff *isl_ast_build_compute_gist_pw_multi_aff(
        __isl_keep isl_ast_build *build, __isl_take isl_pw_multi_aff *pma);
 
+__isl_give isl_union_map *isl_ast_build_substitute_values_union_map_domain(
+       __isl_keep isl_ast_build *build, __isl_take isl_union_map *umap);
+
 int isl_ast_build_aff_is_nonneg(__isl_keep isl_ast_build *build,
        __isl_keep isl_aff *aff);