update isl for isl_union_access_info_compute_flow
[ppcg.git] / ppcg.h
blobbb545ec5d0e3b9957dbee989d81cedeb1abaee85
1 #ifndef PPCG_H
2 #define PPCG_H
4 #include <isl/set.h>
5 #include <isl/union_set.h>
6 #include <isl/union_map.h>
7 #include <isl/id_to_ast_expr.h>
8 #include <pet.h>
10 #include "ppcg_options.h"
12 const char *ppcg_base_name(const char *filename);
13 int ppcg_extract_base_name(char *name, const char *input);
15 /* Representation of the scop for use inside PPCG.
17 * "options" are the options specified by the user.
18 * Some fields in this structure may depend on some of the options.
20 * "start" and "end" are file offsets of the corresponding program text.
21 * "context" represents constraints on the parameters.
22 * "domain" is the union of all iteration domains.
23 * "call" contains the iteration domains of statements with a call expression.
24 * "reads" contains all potential read accesses.
25 * "tagged_reads" is the same as "reads", except that the domain is a wrapped
26 * relation mapping an iteration domain to a reference identifier
27 * "live_in" contains the potential read accesses that potentially
28 * have no corresponding writes in the scop.
29 * "may_writes" contains all potential write accesses.
30 * "tagged_may_writes" is the same as "may_writes", except that the domain
31 * is a wrapped relation mapping an iteration domain
32 * to a reference identifier
33 * "must_writes" contains all definite write accesses.
34 * "tagged_must_writes" is the same as "must_writes", except that the domain
35 * is a wrapped relation mapping an iteration domain
36 * to a reference identifier
37 * "live_out" contains the potential write accesses that are potentially
38 * not killed by any kills or any other writes.
39 * "tagged_must_kills" contains all definite kill accesses with
40 * a reference identifier in the domain.
42 * "tagger" maps iteration domains to the corresponding tagged
43 * iteration domain.
45 * "independence" is the union of all independence filters.
47 * "dep_flow" represents the potential flow dependences.
48 * "tagged_dep_flow" is the same as "dep_flow", except that both domain and
49 * range are wrapped relations mapping an iteration domain to
50 * a reference identifier. May be NULL if not computed.
51 * "dep_false" represents the potential false (anti and output) dependences.
52 * "dep_external" represents the constraints that ensure that all live-in
53 * accesses remain live-in and that all live-out accesses remain live-out.
54 * "dep_order"/"tagged_dep_order" represents the order dependences between
55 * the live range intervals in "dep_flow"/"tagged_dep_flow".
56 * It is only used if the live_range_reordering
57 * option is set. Otherwise it is NULL.
58 * If "dep_order" is used, then "dep_false" only contains a limited
59 * set of anti and output dependences.
60 * "schedule" represents the (original) schedule.
62 * "names" contains all variable names that are in use by the scop.
63 * The names are mapped to a dummy value.
65 * "pet" is the original pet_scop.
67 struct ppcg_scop {
68 struct ppcg_options *options;
70 unsigned start;
71 unsigned end;
73 isl_set *context;
74 isl_union_set *domain;
75 isl_union_set *call;
76 isl_union_map *tagged_reads;
77 isl_union_map *reads;
78 isl_union_map *live_in;
79 isl_union_map *tagged_may_writes;
80 isl_union_map *may_writes;
81 isl_union_map *tagged_must_writes;
82 isl_union_map *must_writes;
83 isl_union_map *live_out;
84 isl_union_map *tagged_must_kills;
86 isl_union_map *tagger;
88 isl_union_map *independence;
90 isl_union_map *dep_flow;
91 isl_union_map *tagged_dep_flow;
92 isl_union_map *dep_false;
93 isl_union_map *dep_external;
94 isl_union_map *dep_order;
95 isl_union_map *tagged_dep_order;
96 isl_union_map *schedule;
98 isl_id_to_ast_expr *names;
100 struct pet_scop *pet;
103 __isl_give isl_id_list *ppcg_scop_generate_names(struct ppcg_scop *scop,
104 int n, const char *prefix);
106 int ppcg_transform(isl_ctx *ctx, const char *input, FILE *out,
107 struct ppcg_options *options,
108 __isl_give isl_printer *(*fn)(__isl_take isl_printer *p,
109 struct ppcg_scop *scop, void *user), void *user);
111 #endif