ppcg.c: eliminate_dead_code: extract out computation of live out accesses
[ppcg.git] / ppcg.h
blob32338abe23db998fc9b04ed68c48ef9f3f0ae220
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 read accesses.
23 * "live_in" contains read accesses that have no corresponding
24 * writes in the scop.
25 * "writes" contains all write accesses.
26 * "live_out" contains the write accesses that are not killed by any kills
27 * or any other writes.
28 * "kills" contains all kill accesses.
29 * "dep_flow" represents the flow dependences.
30 * "dep_false" represents the false (anti and output) dependences.
31 * "schedule" represents the (original) schedule.
33 * "types", "arrays" and "stmts" are copies of the corresponding elements
34 * of the original pet_scop.
36 struct ppcg_scop {
37 struct ppcg_options *options;
39 unsigned start;
40 unsigned end;
42 isl_set *context;
43 isl_union_set *domain;
44 isl_union_set *call;
45 isl_union_map *reads;
46 isl_union_map *live_in;
47 isl_union_map *writes;
48 isl_union_map *live_out;
49 isl_union_map *kills;
50 isl_union_map *dep_flow;
51 isl_union_map *dep_false;
52 isl_union_map *schedule;
54 int n_type;
55 struct pet_type **types;
56 int n_array;
57 struct pet_array **arrays;
58 int n_stmt;
59 struct pet_stmt **stmts;
62 int ppcg_transform(isl_ctx *ctx, const char *input, FILE *out,
63 struct ppcg_options *options,
64 __isl_give isl_printer *(*fn)(__isl_take isl_printer *p,
65 struct ppcg_scop *scop, void *user), void *user);
67 #endif