1 | /* |
2 | * Copyright 2020 Cerebras Systems |
3 | * |
4 | * Use of this software is governed by the MIT license |
5 | * |
6 | * Written by Sven Verdoolaege, |
7 | * Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA |
8 | */ |
9 | |
10 | #include <isl_pw_macro.h> |
11 | |
12 | /* isl_pw_*_every_piece callback that checks whether "set" and "el" |
13 | * are free of local variables. |
14 | */ |
15 | static isl_bool FN(PW,piece_no_local)(__isl_keep isl_set *set, |
16 | __isl_keep EL *el, void *user) |
17 | { |
18 | isl_bool involves; |
19 | |
20 | involves = isl_set_involves_locals(set); |
21 | if (involves >= 0 && !involves) |
22 | involves = FN(EL,involves_locals)(multi: el); |
23 | |
24 | return isl_bool_not(b: involves); |
25 | } |
26 | |
27 | /* Does "pw" involve any local variables, i.e., integer divisions? |
28 | */ |
29 | isl_bool FN(PW,involves_locals)(__isl_keep PW *pw) |
30 | { |
31 | isl_bool no_locals; |
32 | |
33 | no_locals = FN(PW,every_piece)(pw, test: &FN(PW,piece_no_local), NULL); |
34 | return isl_bool_not(b: no_locals); |
35 | } |
36 | |