Polly 19.0.0git
isl_pw_locals_templ.c
Go to the documentation of this file.
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 */
15static 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)(el);
23
24 return isl_bool_not(involves);
25}
26
27/* Does "pw" involve any local variables, i.e., integer divisions?
28 */
29isl_bool FN(PW,involves_locals)(__isl_keep PW *pw)
30{
31 isl_bool no_locals;
32
33 no_locals = FN(PW,every_piece)(pw, &FN(PW,piece_no_local), NULL);
34 return isl_bool_not(no_locals);
35}
#define FN(TYPE, NAME)
#define __isl_keep
Definition: ctx.h:25
isl_bool isl_bool_not(isl_bool b)
Definition: isl_ctx.c:32
isl_bool
Definition: ctx.h:89
isl_stat isl_stat(*) void user)
Definition: hmap.h:39
#define PW
Definition: isl_aff.c:4582
#define EL
const char * set
Definition: isl_test.c:1356
struct isl_set isl_set
Definition: map_type.h:26
__isl_export isl_bool isl_set_involves_locals(__isl_keep isl_set *set)
Definition: isl_map.c:3014