Home | History | Annotate | Download | only in isl
      1 #ifndef ISL_FLOW_H
      2 #define ISL_FLOW_H
      3 
      4 #include <isl/set_type.h>
      5 #include <isl/map_type.h>
      6 #include <isl/union_set_type.h>
      7 #include <isl/union_map_type.h>
      8 
      9 #if defined(__cplusplus)
     10 extern "C" {
     11 #endif
     12 
     13 /* Let n (>= 0) be the number of iterators shared by first and second.
     14  * If first precedes second textually return 2 * n + 1,
     15  * otherwise return 2 * n.
     16  */
     17 typedef int (*isl_access_level_before)(void *first, void *second);
     18 
     19 struct isl_restriction;
     20 typedef struct isl_restriction isl_restriction;
     21 
     22 void *isl_restriction_free(__isl_take isl_restriction *restr);
     23 __isl_give isl_restriction *isl_restriction_empty(
     24 	__isl_take isl_map *source_map);
     25 __isl_give isl_restriction *isl_restriction_none(
     26 	__isl_take isl_map *source_map);
     27 __isl_give isl_restriction *isl_restriction_input(
     28 	__isl_take isl_set *source_restr, __isl_take isl_set *sink_restr);
     29 __isl_give isl_restriction *isl_restriction_output(
     30 	__isl_take isl_set *source_restr);
     31 
     32 isl_ctx *isl_restriction_get_ctx(__isl_keep isl_restriction *restr);
     33 
     34 typedef __isl_give isl_restriction *(*isl_access_restrict)(
     35 	__isl_keep isl_map *source_map, __isl_keep isl_set *sink,
     36 	void *source_user, void *user);
     37 
     38 struct isl_access_info;
     39 typedef struct isl_access_info isl_access_info;
     40 struct isl_flow;
     41 typedef struct isl_flow isl_flow;
     42 
     43 __isl_give isl_access_info *isl_access_info_alloc(__isl_take isl_map *sink,
     44 	void *sink_user, isl_access_level_before fn, int max_source);
     45 __isl_give isl_access_info *isl_access_info_set_restrict(
     46 	__isl_take isl_access_info *acc, isl_access_restrict fn, void *user);
     47 __isl_give isl_access_info *isl_access_info_add_source(
     48 	__isl_take isl_access_info *acc, __isl_take isl_map *source,
     49 	int must, void *source_user);
     50 void *isl_access_info_free(__isl_take isl_access_info *acc);
     51 
     52 isl_ctx *isl_access_info_get_ctx(__isl_keep isl_access_info *acc);
     53 
     54 __isl_give isl_flow *isl_access_info_compute_flow(__isl_take isl_access_info *acc);
     55 int isl_flow_foreach(__isl_keep isl_flow *deps,
     56 	int (*fn)(__isl_take isl_map *dep, int must, void *dep_user, void *user),
     57 	void *user);
     58 __isl_give isl_map *isl_flow_get_no_source(__isl_keep isl_flow *deps, int must);
     59 void isl_flow_free(__isl_take isl_flow *deps);
     60 
     61 isl_ctx *isl_flow_get_ctx(__isl_keep isl_flow *deps);
     62 
     63 int isl_union_map_compute_flow(__isl_take isl_union_map *sink,
     64 	__isl_take isl_union_map *must_source,
     65 	__isl_take isl_union_map *may_source,
     66 	__isl_take isl_union_map *schedule,
     67 	__isl_give isl_union_map **must_dep, __isl_give isl_union_map **may_dep,
     68 	__isl_give isl_union_map **must_no_source,
     69 	__isl_give isl_union_map **may_no_source);
     70 
     71 #if defined(__cplusplus)
     72 }
     73 #endif
     74 
     75 #endif
     76