tree2scop.c: scop_from_affine_for: introduce is_non_affine variable
[pet.git] / skip.h
blob35542f5da04166220297b296a8b9df99fc90d94f
1 #ifndef PET_SKIP_H
2 #define PET_SKIP_H
4 #include <pet.h>
6 #include "state.h"
8 #if defined(__cplusplus)
9 extern "C" {
10 #endif
12 enum pet_skip_type {
13 pet_skip_if,
14 pet_skip_if_else,
15 pet_skip_seq
18 /* Structure that handles the construction of skip conditions.
20 * scop_then and scop_else represent the then and else branches
21 * of the if statement
23 * scop1 and scop2 represent the two statements that are combined
25 * skip[type] is true if we need to construct a skip condition of that type
26 * equal is set if the skip conditions of types pet_skip_now and pet_skip_later
27 * are equal to each other
28 * index[type] is an index expression from a zero-dimension domain
29 * to the virtual array representing the skip condition
30 * scop[type] is a scop for computing the skip condition
32 struct pet_skip_info {
33 isl_ctx *ctx;
35 enum pet_skip_type type;
37 int skip[2];
38 int equal;
39 isl_multi_pw_aff *index[2];
40 struct pet_scop *scop[2];
42 union {
43 struct {
44 struct pet_scop *scop_then;
45 struct pet_scop *scop_else;
46 } i;
47 struct {
48 struct pet_scop *scop1;
49 struct pet_scop *scop2;
50 } s;
51 } u;
54 int pet_skip_info_has_skip(struct pet_skip_info *skip);
56 void pet_skip_info_if_init(struct pet_skip_info *skip, isl_ctx *ctx,
57 struct pet_scop *scop_then, struct pet_scop *scop_else,
58 int have_else, int affine);
59 void pet_skip_info_if_extract_index(struct pet_skip_info *skip,
60 __isl_keep isl_multi_pw_aff *index, struct pet_state *state);
61 void pet_skip_info_if_extract_cond(struct pet_skip_info *skip,
62 __isl_keep isl_pw_aff *cond, struct pet_state *state);
63 struct pet_scop *pet_skip_info_if_add(struct pet_skip_info *skip,
64 struct pet_scop *scop, int offset);
66 void pet_skip_info_seq_init(struct pet_skip_info *skip, isl_ctx *ctx,
67 struct pet_scop *scop1, struct pet_scop *scop2);
68 void pet_skip_info_seq_extract(struct pet_skip_info *skip,
69 struct pet_state *state);
70 struct pet_scop *pet_skip_info_seq_add(struct pet_skip_info *skip,
71 struct pet_scop *scop, int offset);
73 #if defined(__cplusplus)
75 #endif
77 #endif