Polly
20.0.0git
llvm-project
polly
lib
External
isl
isl_pw_scale_templ.c
Go to the documentation of this file.
1
/*
2
* Copyright 2010 INRIA Saclay
3
*
4
* Use of this software is governed by the MIT license
5
*
6
* Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7
* Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
8
* 91893 Orsay, France
9
*/
10
11
#include <
isl_pw_macro.h
>
12
13
__isl_give
PW
*
FN
(
PW
,
scale
)(
__isl_take
PW
*pw,
isl_int
v)
14
{
15
int
i;
16
isl_size
n
;
17
18
if
(
isl_int_is_one
(v))
19
return
pw;
20
if
(pw &&
DEFAULT_IS_ZERO
&&
isl_int_is_zero
(v)) {
21
PW
*zero;
22
isl_space
*space =
FN
(
PW
,get_space)(pw);
23
zero =
FN
(
PW
,
ZERO
)(space
OPT_TYPE_ARG
(pw->));
24
FN
(
PW
,free)(pw);
25
return
zero;
26
}
27
if
(
isl_int_is_neg
(v))
28
pw =
FN
(
PW
,negate_type)(pw);
29
30
n
=
FN
(
PW
,n_piece)(pw);
31
if
(
n
< 0)
32
return
FN
(
PW
,free)(pw);
33
for
(i = 0; i <
n
; ++i) {
34
EL
*el;
35
36
el =
FN
(
PW
,take_base_at)(pw, i);
37
el =
FN
(
EL
,
scale
)(el, v);
38
pw =
FN
(
PW
,restore_base_at)(pw, i, el);
39
}
40
41
return
pw;
42
}
FN
#define FN(TYPE, NAME)
Definition:
check_parse_fail_test_templ.c:15
__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
DEFAULT_IS_ZERO
#define DEFAULT_IS_ZERO
Definition:
isl_aff.c:4594
PW
#define PW
Definition:
isl_aff.c:4582
ZERO
#define ZERO
Definition:
isl_aff.c:4588
EL
#define EL
Definition:
isl_aff_private.h:238
scale
static __isl_give isl_ast_expr * scale(__isl_take isl_ast_expr *expr, __isl_take isl_val *v)
Definition:
isl_ast_build_expr.c:383
isl_int_is_zero
#define isl_int_is_zero(i)
Definition:
isl_int.h:31
isl_int_is_one
#define isl_int_is_one(i)
Definition:
isl_int.h:32
isl_int_is_neg
#define isl_int_is_neg(i)
Definition:
isl_int.h:35
isl_pw_macro.h
OPT_TYPE_ARG
#define OPT_TYPE_ARG(loc)
Definition:
opt_type.h:12
isl_space
Definition:
isl_space_private.h:10
mpz_t
Definition:
imath/imath.h:58
n
n
Definition:
youcefn.c:8
Generated on Wed Nov 13 2024 03:17:26 for Polly by
1.9.6