.gitignore: add compile
[ppcg.git] / ppcg.h
blob0fbfbce72812ee61301fefa82afc7b63b80243b0
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 <pet.h>
9 #include "ppcg_options.h"
11 const char *ppcg_base_name(const char *filename);
12 int ppcg_extract_base_name(char *name, const char *input);
14 /* Representation of the scop for use inside PPCG.
16 * "options" are the options specified by the user.
17 * Some fields in this structure may depend on some of the options.
19 * "start" and "end" are file offsets of the corresponding program text.
20 * "context" represents constraints on the parameters.
21 * "domain" is the union of all iteration domains.
22 * "call" contains the iteration domains of statements with a call expression.
23 * "reads" contains all potential read accesses.
24 * "tagged_reads" is the same as "reads", except that the domain is a wrapped
25 * relation mapping an iteration domain to a reference identifier
26 * "live_in" contains the potential read accesses that potentially
27 * have no corresponding writes in the scop.
28 * "may_writes" contains all potential write accesses.
29 * "tagged_may_writes" is the same as "may_writes", except that the domain
30 * is a wrapped relation mapping an iteration domain
31 * to a reference identifier
32 * "must_writes" contains all definite write accesses.
33 * "tagged_must_writes" is the same as "must_writes", except that the domain
34 * is a wrapped relation mapping an iteration domain
35 * to a reference identifier
36 * "live_out" contains the potential write accesses that are potentially
37 * not killed by any kills or any other writes.
38 * "tagged_must_kills" contains all definite kill accesses with
39 * a reference identifier in the domain.
41 * "tagger" maps iteration domains to the corresponding tagged
42 * iteration domain.
44 * "independence" is the union of all independence filters.
46 * "dep_flow" represents the potential flow dependences.
47 * "tagged_dep_flow" is the same as "dep_flow", except that both domain and
48 * range are wrapped relations mapping an iteration domain to
49 * a reference identifier. May be NULL if not computed.
50 * "dep_false" represents the potential false (anti and output) dependences.
51 * "dep_external" represents the constraints that ensure that all live-in
52 * accesses remain live-in and that all live-out accesses remain live-out.
53 * "dep_order"/"tagged_dep_order" represents the order dependences between
54 * the live range intervals in "dep_flow"/"tagged_dep_flow".
55 * It is only used if the live_range_reordering
56 * option is set. Otherwise it is NULL.
57 * If "dep_order" is used, then "dep_false" only contains a limited
58 * set of anti and output dependences.
59 * "schedule" represents the (original) schedule.
61 * "pet" is the original pet_scop.
63 struct ppcg_scop {
64 struct ppcg_options *options;
66 unsigned start;
67 unsigned end;
69 isl_set *context;
70 isl_union_set *domain;
71 isl_union_set *call;
72 isl_union_map *tagged_reads;
73 isl_union_map *reads;
74 isl_union_map *live_in;
75 isl_union_map *tagged_may_writes;
76 isl_union_map *may_writes;
77 isl_union_map *tagged_must_writes;
78 isl_union_map *must_writes;
79 isl_union_map *live_out;
80 isl_union_map *tagged_must_kills;
82 isl_union_map *tagger;
84 isl_union_map *independence;
86 isl_union_map *dep_flow;
87 isl_union_map *tagged_dep_flow;
88 isl_union_map *dep_false;
89 isl_union_map *dep_external;
90 isl_union_map *dep_order;
91 isl_union_map *tagged_dep_order;
92 isl_union_map *schedule;
94 struct pet_scop *pet;
97 int ppcg_transform(isl_ctx *ctx, const char *input, FILE *out,
98 struct ppcg_options *options,
99 __isl_give isl_printer *(*fn)(__isl_take isl_printer *p,
100 struct ppcg_scop *scop, void *user), void *user);
102 #endif