handle data dependent accesses
[ppcg.git] / ppcg.h
blob40598739afa57cf8d378caf82a9df6ae4c75a72d
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 * "dep_false" represents the potential false (anti and output) dependences.
45 * "schedule" represents the (original) schedule.
47 * "types", "arrays" and "stmts" are copies of the corresponding elements
48 * of the original pet_scop.
50 struct ppcg_scop {
51 struct ppcg_options *options;
53 unsigned start;
54 unsigned end;
56 isl_set *context;
57 isl_union_set *domain;
58 isl_union_set *call;
59 isl_union_map *tagged_reads;
60 isl_union_map *reads;
61 isl_union_map *live_in;
62 isl_union_map *tagged_may_writes;
63 isl_union_map *may_writes;
64 isl_union_map *tagged_must_writes;
65 isl_union_map *must_writes;
66 isl_union_map *live_out;
67 isl_union_map *tagged_must_kills;
69 isl_union_map *tagger;
71 isl_union_map *dep_flow;
72 isl_union_map *dep_false;
73 isl_union_map *schedule;
75 int n_type;
76 struct pet_type **types;
77 int n_array;
78 struct pet_array **arrays;
79 int n_stmt;
80 struct pet_stmt **stmts;
83 int ppcg_transform(isl_ctx *ctx, const char *input, FILE *out,
84 struct ppcg_options *options,
85 __isl_give isl_printer *(*fn)(__isl_take isl_printer *p,
86 struct ppcg_scop *scop, void *user), void *user);
88 #endif