update isl to version 0.17.1
[ppcg.git] / ppcg.h
blobe4b1ab3f7612f3bd267ee79bc7ca4f8b13548ea0
1 #ifndef PPCG_H
2 #define PPCG_H
4 #include <isl/schedule.h>
5 #include <isl/set.h>
6 #include <isl/union_set.h>
7 #include <isl/union_map.h>
8 #include <isl/id_to_ast_expr.h>
9 #include <pet.h>
11 #include "ppcg_options.h"
13 const char *ppcg_base_name(const char *filename);
14 int ppcg_extract_base_name(char *name, const char *input);
16 /* Representation of the scop for use inside PPCG.
18 * "options" are the options specified by the user.
19 * Some fields in this structure may depend on some of the options.
21 * "start" and "end" are file offsets of the corresponding program text.
22 * "context" represents constraints on the parameters.
23 * "domain" is the union of all iteration domains.
24 * "call" contains the iteration domains of statements with a call expression.
25 * "reads" contains all potential read accesses.
26 * "tagged_reads" is the same as "reads", except that the domain is a wrapped
27 * relation mapping an iteration domain to a reference identifier
28 * "live_in" contains the potential read accesses that potentially
29 * have no corresponding writes in the scop.
30 * "may_writes" contains all potential write accesses.
31 * "tagged_may_writes" is the same as "may_writes", except that the domain
32 * is a wrapped relation mapping an iteration domain
33 * to a reference identifier
34 * "must_writes" contains all definite write accesses.
35 * "tagged_must_writes" is the same as "must_writes", except that the domain
36 * is a wrapped relation mapping an iteration domain
37 * to a reference identifier
38 * "live_out" contains the potential write accesses that are potentially
39 * not killed by any kills or any other writes.
40 * "must_kills" contains all definite kill accesses.
41 * "tagged_must_kills" is the same as "must_kills", except that the domain
42 * is a wrapped relation mapping an iteration domain
43 * to a reference identifier.
45 * "tagger" maps tagged iteration domains to the corresponding untagged
46 * iteration domain.
48 * "independence" is the union of all independence filters.
50 * "dep_flow" represents the potential flow dependences.
51 * "tagged_dep_flow" is the same as "dep_flow", except that both domain and
52 * range are wrapped relations mapping an iteration domain to
53 * a reference identifier. May be NULL if not computed.
54 * "dep_false" represents the potential false (anti and output) dependences.
55 * "dep_forced" represents the validity constraints that should be enforced
56 * even when live-range reordering is used.
57 * In particular, these constraints ensure that all live-in
58 * accesses remain live-in and that all live-out accesses remain live-out
59 * and that multiple potential sources for the same read are
60 * executed in the original order.
61 * "dep_order"/"tagged_dep_order" represents the order dependences between
62 * the live range intervals in "dep_flow"/"tagged_dep_flow".
63 * It is only used if the live_range_reordering
64 * option is set. Otherwise it is NULL.
65 * If "dep_order" is used, then "dep_false" only contains a limited
66 * set of anti and output dependences.
67 * "schedule" represents the (original) schedule.
69 * "names" contains all variable names that are in use by the scop.
70 * The names are mapped to a dummy value.
72 * "pet" is the original pet_scop.
74 struct ppcg_scop {
75 struct ppcg_options *options;
77 unsigned start;
78 unsigned end;
80 isl_set *context;
81 isl_union_set *domain;
82 isl_union_set *call;
83 isl_union_map *tagged_reads;
84 isl_union_map *reads;
85 isl_union_map *live_in;
86 isl_union_map *tagged_may_writes;
87 isl_union_map *may_writes;
88 isl_union_map *tagged_must_writes;
89 isl_union_map *must_writes;
90 isl_union_map *live_out;
91 isl_union_map *tagged_must_kills;
92 isl_union_map *must_kills;
94 isl_union_pw_multi_aff *tagger;
96 isl_union_map *independence;
98 isl_union_map *dep_flow;
99 isl_union_map *tagged_dep_flow;
100 isl_union_map *dep_false;
101 isl_union_map *dep_forced;
102 isl_union_map *dep_order;
103 isl_union_map *tagged_dep_order;
104 isl_schedule *schedule;
106 isl_id_to_ast_expr *names;
108 struct pet_scop *pet;
111 int ppcg_scop_any_hidden_declarations(struct ppcg_scop *scop);
112 __isl_give isl_id_list *ppcg_scop_generate_names(struct ppcg_scop *scop,
113 int n, const char *prefix);
115 int ppcg_transform(isl_ctx *ctx, const char *input, FILE *out,
116 struct ppcg_options *options,
117 __isl_give isl_printer *(*fn)(__isl_take isl_printer *p,
118 struct ppcg_scop *scop, void *user), void *user);
120 __isl_give isl_schedule *ppcg_compute_schedule(
121 __isl_take isl_schedule_constraints *sc,
122 __isl_keep isl_schedule *schedule, struct ppcg_options *options);
124 #endif