Polly
22.0.0git
llvm-project
polly
lib
External
isl
isl_ilp_opt_val_templ.c
Go to the documentation of this file.
1
/*
2
* Copyright 2017 Sven Verdoolaege
3
*
4
* Use of this software is governed by the MIT license
5
*
6
* Written by Sven Verdoolaege
7
*/
8
9
#define xCAT(A,B) A ## B
10
#define CAT(A,B) xCAT(A,B)
11
#undef TYPE
12
#define TYPE CAT(isl_,BASE)
13
#define xBFN(BASE,NAME) isl_ ## BASE ## _ ## NAME
14
#define BFN(BASE,NAME) xBFN(BASE,NAME)
15
16
/* Return the minimal (maximal if "max" is set) value attained
17
* by the given set dimension,
18
* independently of the parameter values and of any other dimensions.
19
*
20
* Return infinity or negative infinity if the optimal value is unbounded and
21
* NaN if "set" is empty.
22
*/
23
static
__isl_give
isl_val
*
BFN
(
BASE
,dim_opt_val)(
__isl_take
TYPE
*
set
,
int
max,
24
int
pos
)
25
{
26
isl_local_space
*ls;
27
isl_aff
*
obj
;
28
isl_val
*v;
29
30
if
(
BFN
(
BASE
,check_range)(
set
,
isl_dim_set
,
pos
, 1) < 0)
31
goto
error;
32
ls =
isl_local_space_from_space
(
BFN
(
BASE
,get_space)(
set
));
33
obj
=
isl_aff_var_on_domain
(ls,
isl_dim_set
,
pos
);
34
v =
BFN
(
BASE
,opt_val)(
set
, max,
obj
);
35
isl_aff_free
(
obj
);
36
BFN
(
BASE
,free)(
set
);
37
38
return
v;
39
error:
40
BFN
(
BASE
,free)(
set
);
41
return
NULL;
42
}
isl_aff_free
__isl_null isl_aff * isl_aff_free(__isl_take isl_aff *aff)
Definition
isl_aff.c:390
isl_aff_var_on_domain
__isl_give isl_aff * isl_aff_var_on_domain(__isl_take isl_local_space *ls, enum isl_dim_type type, unsigned pos)
Definition
isl_aff.c:311
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
BASE
#define BASE
Definition
flow_cmp.c:49
BFN
#define BFN(BASE, NAME)
Definition
isl_ilp_opt_val_templ.c:14
pos
static unsigned pos(__isl_keep isl_space *space, enum isl_dim_type type)
Definition
isl_map.c:70
set
const char * set
Definition
isl_test.c:1356
obj
const char * obj
Definition
isl_test.c:3316
isl_local_space_from_space
__isl_give isl_local_space * isl_local_space_from_space(__isl_take isl_space *space)
Definition
isl_local_space.c:93
isl_dim_set
@ isl_dim_set
Definition
space_type.h:18
isl_aff
Definition
isl_aff_private.h:17
isl_local_space
Definition
isl_local_space_private.h:8
isl_val
Definition
isl_val_private.h:17
Generated on
for Polly by
1.14.0