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