Polly
20.0.0git
llvm-project
polly
lib
External
isl
isl_ilp_opt_multi_val_templ.c
Go to the documentation of this file.
1
/*
2
* Copyright 2019 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
#define xFN(TYPE,NAME) TYPE ## _ ## NAME
11
#define FN(TYPE,NAME) xFN(TYPE,NAME)
12
13
/* Return a list of minima (maxima if "max" is set)
14
* for each of the expressions in "f" over their (shared) domain.
15
*
16
* An element in the list is infinity or negative infinity if the optimal
17
* value of the corresponding expression is unbounded and
18
* NaN if the domain of the expression is empty.
19
*
20
* Iterate over all the expressions in "f" and collect the results.
21
*/
22
static
__isl_give
isl_multi_val
*
FN
(
TYPE
,opt_multi_val)(
__isl_take
TYPE
*
f
,
23
int
max)
24
{
25
int
i;
26
isl_size
n
;
27
isl_space
*space;
28
isl_multi_val
*mv;
29
30
n
=
FN
(
TYPE
,dim)(
f
,
isl_dim_out
);
31
if
(
n
< 0)
32
f
=
FN
(
TYPE
,free)(
f
);
33
if
(!
f
)
34
return
NULL;
35
36
space =
isl_space_range
(
FN
(
TYPE
,get_space)(
f
));
37
space =
isl_space_drop_all_params
(space);
38
mv = isl_multi_val_zero(space);
39
40
for
(i = 0; i <
n
; ++i) {
41
isl_val
*v;
42
isl_pw_aff
*pa;
43
44
pa =
FN
(
TYPE
,get_pw_aff)(
f
, i);
45
v =
isl_pw_aff_opt_val
(pa, max);
46
mv = isl_multi_val_set_val(mv, i, v);
47
}
48
49
FN
(
TYPE
,free)(
f
);
50
return
mv;
51
}
52
53
/* Return a list of minima
54
* for each of the expressions in "f" over their (shared) domain.
55
*
56
* An element in the list is negative infinity if the optimal
57
* value of the corresponding expression is unbounded and
58
* NaN if the domain of the expression is empty.
59
*/
60
__isl_give
isl_multi_val
*
FN
(
TYPE
,min_multi_val)(
__isl_take
TYPE
*
f
)
61
{
62
return
FN
(
TYPE
,opt_multi_val)(
f
, 0);
63
}
64
65
/* Return a list of maxima
66
* for each of the expressions in "f" over their (shared) domain.
67
*
68
* An element in the list is infinity if the optimal
69
* value of the corresponding expression is unbounded and
70
* NaN if the domain of the expression is empty.
71
*/
72
__isl_give
isl_multi_val
*
FN
(
TYPE
,max_multi_val)(
__isl_take
TYPE
*
f
)
73
{
74
return
FN
(
TYPE
,opt_multi_val)(
f
, 1);
75
}
TYPE
#define TYPE
Definition:
check_parse_fail_test_templ.c:13
__isl_take
#define __isl_take
Definition:
ctx.h:22
__isl_give
#define __isl_give
Definition:
ctx.h:19
isl_size
int isl_size
Definition:
ctx.h:96
isl_pw_aff_opt_val
static __isl_give isl_val * isl_pw_aff_opt_val(__isl_take isl_pw_aff *pa, int max)
Definition:
isl_ilp.c:685
FN
#define FN(TYPE, NAME)
Definition:
isl_ilp_opt_multi_val_templ.c:11
f
const char * f
Definition:
isl_test.c:8642
isl_space_range
__isl_export __isl_give isl_space * isl_space_range(__isl_take isl_space *space)
Definition:
isl_space.c:2163
isl_space_drop_all_params
__isl_give isl_space * isl_space_drop_all_params(__isl_take isl_space *space)
Definition:
isl_space.c:2128
isl_dim_out
@ isl_dim_out
Definition:
space_type.h:17
isl_pw_aff
Definition:
isl_aff_private.h:34
isl_space
Definition:
isl_space_private.h:10
isl_val
Definition:
isl_val_private.h:17
isl_multi_val
struct isl_multi_val isl_multi_val
Definition:
val_type.h:16
n
n
Definition:
youcefn.c:8
Generated on Wed Nov 13 2024 03:17:22 for Polly by
1.9.6