File: isl_multi_param_templ.c

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (60 lines) | stat: -rw-r--r-- 1,307 bytes parent folder | download | duplicates (25)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * Use of this software is governed by the MIT license
 *
 * Written by Sven Verdoolaege
 */

#include <isl_multi_macro.h>

/* Does the multiple expression "multi" depend in any way
 * on the parameter with identifier "id"?
 */
isl_bool FN(MULTI(BASE),involves_param_id)(__isl_keep MULTI(BASE) *multi,
	__isl_keep isl_id *id)
{
	int i;
	int pos;

	if (!multi || !id)
		return isl_bool_error;
	if (multi->n == 0)
		return isl_bool_false;
	pos = FN(MULTI(BASE),find_dim_by_id)(multi, isl_dim_param, id);
	if (pos < 0)
		return isl_bool_false;

	for (i = 0; i < multi->n; ++i) {
		isl_bool involved = FN(EL,involves_param_id)(multi->u.p[i], id);
		if (involved < 0 || involved)
			return involved;
	}

	return isl_bool_false;
}

/* Does the multiple expression "multi" depend in any way
 * on any of the parameters with identifiers in "list"?
 */
isl_bool FN(MULTI(BASE),involves_param_id_list)(__isl_keep MULTI(BASE) *multi,
	__isl_keep isl_id_list *list)
{
	int i;
	isl_size n;

	n = isl_id_list_size(list);
	if (n < 0)
		return isl_bool_error;
	for (i = 0; i < n; ++i) {
		isl_bool involves;
		isl_id *id;

		id = isl_id_list_get_at(list, i);
		involves = FN(MULTI(BASE),involves_param_id)(multi, id);
		isl_id_free(id);

		if (involves < 0 || involves)
			return involves;
	}

	return isl_bool_false;
}