Polly 23.0.0git
isl_multi_intersect.c
Go to the documentation of this file.
1/*
2 * Copyright 2011 Sven Verdoolaege
3 * Copyright 2012-2013 Ecole Normale Superieure
4 *
5 * Use of this software is governed by the MIT license
6 *
7 * Written by Sven Verdoolaege,
8 * Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France
9 */
10
11#include <isl_multi_macro.h>
12
13/* Intersect the parameter domain "dom1" with "dom2".
14 * That is, intersect the parameters of "dom2" with "dom1".
15 *
16 * Even though "dom1" is known to only involve parameter constraints,
17 * it may be of type isl_union_set, so explicitly convert it
18 * to an isl_set first.
19 */
20static __isl_give DOM *FN(MULTI(BASE),params_domain_intersect)(DOM *dom1,
21 __isl_take DOM *dom2)
22{
24
25 params = FN(DOM,params)(dom1);
26 dom2 = FN(DOM,intersect_params)(dom2, params);
27
28 return dom2;
29}
30
31/* Intersect the domain of "multi" with "domain".
32 *
33 * If "multi" has an explicit domain, then only this domain
34 * needs to be intersected.
35 */
36__isl_give MULTI(BASE) *FN(MULTI(BASE),intersect_domain)(
38{
39 if (FN(MULTI(BASE),check_compatible_domain)(multi, domain) < 0)
40 domain = FN(DOM,free)(domain);
41 return FN(FN(MULTI(BASE),apply),DOMBASE)(multi, domain,
42 &FN(EL,intersect_domain),
44 &FN(MULTI(BASE),params_domain_intersect));
45}
46
47/* Intersect the parameter domain of "multi" with "domain".
48 *
49 * If "multi" has an explicit domain, then only this domain
50 * needs to be intersected.
51 */
52__isl_give MULTI(BASE) *FN(MULTI(BASE),intersect_params)(
54{
55 return FN(MULTI(BASE),apply_set)(multi, domain,
56 &FN(EL,intersect_params),
57 &FN(DOM,intersect_params),
58 &FN(DOM,intersect_params));
59}
#define FN(TYPE, NAME)
#define __isl_take
Definition ctx.h:22
#define __isl_give
Definition ctx.h:19
#define BASE
Definition flow_cmp.c:49
#define DOMBASE
Definition isl_aff.c:4121
#define EL
#define isl_set
#define MULTI(BASE)
#define DOM
static Kind params
static TupleKindPtr apply(const TupleKindPtr tuple, const Substitution &subs)
static Signature domain
static std::vector< std::string > intersect(const std::vector< std::string > &v1, const std::vector< std::string > &v2)