Polly 20.0.0git
isl_multi_align_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/* Align the parameters of "multi" and "domain" (if needed) and
10 * call "fn".
11 */
16{
17 isl_bool aligned;
18 isl_bool named;
19 isl_space *dom_space;
20
21 aligned = FN(ALIGN_DOM,space_has_equal_params)(domain, multi->space);
22 if (aligned < 0)
23 goto error;
24 if (aligned)
25 return fn(multi, domain);
26
27 dom_space = FN(ALIGN_DOM,peek_space)(domain);
28 named = isl_space_has_named_params(multi->space);
29 if (named >= 0 && named)
30 named = isl_space_has_named_params(dom_space);
31 if (named < 0)
32 goto error;
33 if (!named)
34 isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
35 "unaligned unnamed parameters", goto error);
36 multi = FN(MULTI(BASE),align_params)(multi,
37 FN(ALIGN_DOM,get_space)(domain));
39 FN(MULTI(BASE),get_space)(multi));
40 return fn(multi, domain);
41error:
42 FN(MULTI(BASE),free)(multi);
43 FN(ALIGN_DOM,free)(domain);
44 return NULL;
45}
#define FN(TYPE, NAME)
#define __isl_take
Definition: ctx.h:22
#define __isl_give
Definition: ctx.h:19
#define isl_die(ctx, errno, msg, code)
Definition: ctx.h:137
@ isl_error_invalid
Definition: ctx.h:80
isl_bool
Definition: ctx.h:89
#define BASE
Definition: flow_cmp.c:49
isl_stat isl_stat(* fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user)
Definition: hmap.h:37
#define ALIGN_DOM
#define ALIGN_DOMBASE
#define MULTI(BASE)
static __isl_give isl_schedule_node * align_params(__isl_take isl_schedule_node *node, void *user)
Definition: isl_schedule.c:311
isl_bool isl_space_has_named_params(__isl_keep isl_space *space)
Definition: isl_space.c:3225
static Signature domain