1 #ifndef ISL_FLOW_H 2 #define ISL_FLOW_H 3 4 #include <stdio.h> 5 6 #include <isl/set_type.h> 7 #include <isl/map_type.h> 8 #include <isl/union_set_type.h> 9 #include <isl/union_map_type.h> 10 #include <isl/schedule.h> 11 #include <isl/printer.h> 12 13 #if defined(__cplusplus) 14 extern "C" { 15 #endif 16 17 /* Let n (>= 0) be the number of iterators shared by first and second. 18 * If first precedes second textually return 2 * n + 1, 19 * otherwise return 2 * n. 20 */ 21 typedef int (*isl_access_level_before)(void *first, void *second); 22 23 struct isl_restriction; 24 typedef struct isl_restriction isl_restriction; 25 26 __isl_null isl_restriction *isl_restriction_free( 27 __isl_take isl_restriction *restr); 28 __isl_give isl_restriction *isl_restriction_empty( 29 __isl_take isl_map *source_map); 30 __isl_give isl_restriction *isl_restriction_none( 31 __isl_take isl_map *source_map); 32 __isl_give isl_restriction *isl_restriction_input( 33 __isl_take isl_set *source_restr, __isl_take isl_set *sink_restr); 34 __isl_give isl_restriction *isl_restriction_output( 35 __isl_take isl_set *source_restr); 36 37 isl_ctx *isl_restriction_get_ctx(__isl_keep isl_restriction *restr); 38 39 typedef __isl_give isl_restriction *(*isl_access_restrict)( 40 __isl_keep isl_map *source_map, __isl_keep isl_set *sink, 41 void *source_user, void *user); 42 43 struct isl_access_info; 44 typedef struct isl_access_info isl_access_info; 45 struct isl_flow; 46 typedef struct isl_flow isl_flow; 47 48 __isl_give isl_access_info *isl_access_info_alloc(__isl_take isl_map *sink, 49 void *sink_user, isl_access_level_before fn, int max_source); 50 __isl_give isl_access_info *isl_access_info_set_restrict( 51 __isl_take isl_access_info *acc, isl_access_restrict fn, void *user); 52 __isl_give isl_access_info *isl_access_info_add_source( 53 __isl_take isl_access_info *acc, __isl_take isl_map *source, 54 int must, void *source_user); 55 __isl_null isl_access_info *isl_access_info_free( 56 __isl_take isl_access_info *acc); 57 58 isl_ctx *isl_access_info_get_ctx(__isl_keep isl_access_info *acc); 59 60 __isl_give isl_flow *isl_access_info_compute_flow(__isl_take isl_access_info *acc); 61 isl_stat isl_flow_foreach(__isl_keep isl_flow *deps, 62 isl_stat (*fn)(__isl_take isl_map *dep, int must, void *dep_user, 63 void *user), 64 void *user); 65 __isl_give isl_map *isl_flow_get_no_source(__isl_keep isl_flow *deps, int must); 66 __isl_null isl_flow *isl_flow_free(__isl_take isl_flow *deps); 67 68 isl_ctx *isl_flow_get_ctx(__isl_keep isl_flow *deps); 69 70 struct __isl_export isl_union_access_info; 71 typedef struct isl_union_access_info isl_union_access_info; 72 struct __isl_export isl_union_flow; 73 typedef struct isl_union_flow isl_union_flow; 74 75 __isl_constructor 76 __isl_give isl_union_access_info *isl_union_access_info_from_sink( 77 __isl_take isl_union_map *sink); 78 __isl_export 79 __isl_give isl_union_access_info *isl_union_access_info_set_must_source( 80 __isl_take isl_union_access_info *access, 81 __isl_take isl_union_map *must_source); 82 __isl_export 83 __isl_give isl_union_access_info *isl_union_access_info_set_may_source( 84 __isl_take isl_union_access_info *access, 85 __isl_take isl_union_map *may_source); 86 __isl_export 87 __isl_give isl_union_access_info *isl_union_access_info_set_kill( 88 __isl_take isl_union_access_info *access, 89 __isl_take isl_union_map *kill); 90 __isl_export 91 __isl_give isl_union_access_info *isl_union_access_info_set_schedule( 92 __isl_take isl_union_access_info *access, 93 __isl_take isl_schedule *schedule); 94 __isl_export 95 __isl_give isl_union_access_info *isl_union_access_info_set_schedule_map( 96 __isl_take isl_union_access_info *access, 97 __isl_take isl_union_map *schedule_map); 98 __isl_give isl_union_access_info *isl_union_access_info_copy( 99 __isl_keep isl_union_access_info *access); 100 __isl_null isl_union_access_info *isl_union_access_info_free( 101 __isl_take isl_union_access_info *access); 102 103 isl_ctx *isl_union_access_info_get_ctx( 104 __isl_keep isl_union_access_info *access); 105 106 __isl_give isl_union_access_info *isl_union_access_info_read_from_file( 107 isl_ctx *ctx, FILE *input); 108 __isl_give isl_printer *isl_printer_print_union_access_info( 109 __isl_take isl_printer *p, __isl_keep isl_union_access_info *access); 110 __isl_give char *isl_union_access_info_to_str( 111 __isl_keep isl_union_access_info *access); 112 113 __isl_export 114 __isl_give isl_union_flow *isl_union_access_info_compute_flow( 115 __isl_take isl_union_access_info *access); 116 117 isl_ctx *isl_union_flow_get_ctx(__isl_keep isl_union_flow *flow); 118 __isl_give isl_union_flow *isl_union_flow_copy( 119 __isl_keep isl_union_flow *flow); 120 __isl_export 121 __isl_give isl_union_map *isl_union_flow_get_must_dependence( 122 __isl_keep isl_union_flow *flow); 123 __isl_export 124 __isl_give isl_union_map *isl_union_flow_get_may_dependence( 125 __isl_keep isl_union_flow *flow); 126 __isl_export 127 __isl_give isl_union_map *isl_union_flow_get_full_must_dependence( 128 __isl_keep isl_union_flow *flow); 129 __isl_export 130 __isl_give isl_union_map *isl_union_flow_get_full_may_dependence( 131 __isl_keep isl_union_flow *flow); 132 __isl_export 133 __isl_give isl_union_map *isl_union_flow_get_must_no_source( 134 __isl_keep isl_union_flow *flow); 135 __isl_export 136 __isl_give isl_union_map *isl_union_flow_get_may_no_source( 137 __isl_keep isl_union_flow *flow); 138 __isl_null isl_union_flow *isl_union_flow_free(__isl_take isl_union_flow *flow); 139 140 __isl_give isl_printer *isl_printer_print_union_flow( 141 __isl_take isl_printer *p, __isl_keep isl_union_flow *flow); 142 __isl_give char *isl_union_flow_to_str(__isl_keep isl_union_flow *flow); 143 144 int isl_union_map_compute_flow(__isl_take isl_union_map *sink, 145 __isl_take isl_union_map *must_source, 146 __isl_take isl_union_map *may_source, 147 __isl_take isl_union_map *schedule, 148 __isl_give isl_union_map **must_dep, __isl_give isl_union_map **may_dep, 149 __isl_give isl_union_map **must_no_source, 150 __isl_give isl_union_map **may_no_source); 151 152 #if defined(__cplusplus) 153 } 154 #endif 155 156 #endif 157