Coverage Report

Created: 2017-10-03 07:32

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/polly/lib/External/isl/isl_multi_apply_templ.c
Line
Count
Source (jump to first uncovered line)
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
/* Transform the elements of "multi" by applying "fn" to them
14
 * with extra argument "set".
15
 *
16
 * The parameters of "multi" and "set" are assumed to have been aligned.
17
 */
18
__isl_give MULTI(BASE) *FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(
19
  __isl_take MULTI(BASE) *multi, __isl_take APPLY_DOM *set,
20
  __isl_give EL *(*fn)(EL *el, __isl_take APPLY_DOM *set))
21
3.00k
{
22
3.00k
  int i;
23
3.00k
24
3.00k
  if (
!multi || 3.00k
!set3.00k
)
25
0
    goto error;
26
3.00k
27
3.00k
  
if (3.00k
multi->n == 03.00k
) {
28
45
    FN(APPLY_DOM,free)(set);
29
45
    return multi;
30
45
  }
31
3.00k
32
2.95k
  
multi = 2.95k
FN2.95k
(MULTI(BASE),cow)(multi);
33
2.95k
  if (!multi)
34
0
    goto error;
35
2.95k
36
9.61k
  
for (i = 0; 2.95k
i < multi->n9.61k
;
++i6.65k
) {
37
6.65k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
6.65k
    if (!multi->p[i])
39
0
      goto error;
40
6.65k
  }
41
2.95k
42
2.95k
  
FN2.95k
(APPLY_DOM,free)(set);
43
2.95k
  return multi;
44
0
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
3.00k
}
isl_multi_aff_apply_aligned_set
Line
Count
Source
21
2.76k
{
22
2.76k
  int i;
23
2.76k
24
2.76k
  if (
!multi || 2.76k
!set2.76k
)
25
0
    goto error;
26
2.76k
27
2.76k
  
if (2.76k
multi->n == 02.76k
) {
28
45
    FN(APPLY_DOM,free)(set);
29
45
    return multi;
30
45
  }
31
2.76k
32
2.72k
  
multi = 2.72k
FN2.72k
(MULTI(BASE),cow)(multi);
33
2.72k
  if (!multi)
34
0
    goto error;
35
2.72k
36
9.14k
  
for (i = 0; 2.72k
i < multi->n9.14k
;
++i6.42k
) {
37
6.42k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
6.42k
    if (!multi->p[i])
39
0
      goto error;
40
6.42k
  }
41
2.72k
42
2.72k
  
FN2.72k
(APPLY_DOM,free)(set);
43
2.72k
  return multi;
44
0
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
2.76k
}
Unexecuted instantiation: isl_multi_union_pw_aff_apply_aligned_set
isl_multi_pw_aff_apply_aligned_set
Line
Count
Source
21
4
{
22
4
  int i;
23
4
24
4
  if (
!multi || 4
!set4
)
25
0
    goto error;
26
4
27
4
  
if (4
multi->n == 04
) {
28
0
    FN(APPLY_DOM,free)(set);
29
0
    return multi;
30
0
  }
31
4
32
4
  
multi = 4
FN4
(MULTI(BASE),cow)(multi);
33
4
  if (!multi)
34
0
    goto error;
35
4
36
9
  
for (i = 0; 4
i < multi->n9
;
++i5
) {
37
5
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
5
    if (!multi->p[i])
39
0
      goto error;
40
5
  }
41
4
42
4
  
FN4
(APPLY_DOM,free)(set);
43
4
  return multi;
44
0
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
4
}
isl_multi_union_pw_aff_apply_aligned_union_set
Line
Count
Source
21
228
{
22
228
  int i;
23
228
24
228
  if (
!multi || 228
!set228
)
25
0
    goto error;
26
228
27
228
  
if (228
multi->n == 0228
) {
28
0
    FN(APPLY_DOM,free)(set);
29
0
    return multi;
30
0
  }
31
228
32
228
  
multi = 228
FN228
(MULTI(BASE),cow)(multi);
33
228
  if (!multi)
34
0
    goto error;
35
228
36
456
  
for (i = 0; 228
i < multi->n456
;
++i228
) {
37
228
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
228
    if (!multi->p[i])
39
0
      goto error;
40
228
  }
41
228
42
228
  
FN228
(APPLY_DOM,free)(set);
43
228
  return multi;
44
0
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
228
}
49
50
/* Transform the elements of "multi" by applying "fn" to them
51
 * with extra argument "set".
52
 *
53
 * Align the parameters if needed and call apply_set_aligned.
54
 */
55
static __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),apply),APPLY_DOMBASE)(
56
  __isl_take MULTI(BASE) *multi, __isl_take APPLY_DOM *set,
57
  __isl_give EL *(*fn)(EL *el, __isl_take APPLY_DOM *set))
58
3.00k
{
59
3.00k
  isl_bool aligned;
60
3.00k
  isl_ctx *ctx;
61
3.00k
62
3.00k
  if (
!multi || 3.00k
!set3.00k
)
63
0
    goto error;
64
3.00k
65
3.00k
  
aligned = 3.00k
FN3.00k
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
3.00k
  if (aligned < 0)
67
0
    goto error;
68
3.00k
  
if (3.00k
aligned3.00k
)
69
2.94k
    
return 2.94k
FN2.94k
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
2.94k
                    set, fn);
71
60
  
ctx = 60
FN60
(MULTI(BASE),get_ctx)(multi);
72
60
  if (!isl_space_has_named_params(multi->space) ||
73
60
      !isl_space_has_named_params(set->dim))
74
0
    isl_die(ctx, isl_error_invalid,
75
60
      "unaligned unnamed parameters", goto error);
76
60
  
multi = 60
FN60
(MULTI(BASE),align_params)(multi,
77
60
            FN(APPLY_DOM,get_space)(set));
78
60
  set = 
FN60
(APPLY_DOM,align_params)(set,
FN60
(MULTI(BASE),get_space)(multi));
79
60
  return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi, set, fn);
80
0
error:
81
0
  FN(MULTI(BASE),free)(multi);
82
0
  FN(APPLY_DOM,free)(set);
83
0
  return NULL;
84
3.00k
}
Unexecuted instantiation: isl_aff.c:isl_multi_union_pw_aff_apply_set
isl_aff.c:isl_multi_union_pw_aff_apply_union_set
Line
Count
Source
58
228
{
59
228
  isl_bool aligned;
60
228
  isl_ctx *ctx;
61
228
62
228
  if (
!multi || 228
!set228
)
63
0
    goto error;
64
228
65
228
  
aligned = 228
FN228
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
228
  if (aligned < 0)
67
0
    goto error;
68
228
  
if (228
aligned228
)
69
168
    
return 168
FN168
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
168
                    set, fn);
71
60
  
ctx = 60
FN60
(MULTI(BASE),get_ctx)(multi);
72
60
  if (!isl_space_has_named_params(multi->space) ||
73
60
      !isl_space_has_named_params(set->dim))
74
0
    isl_die(ctx, isl_error_invalid,
75
60
      "unaligned unnamed parameters", goto error);
76
60
  
multi = 60
FN60
(MULTI(BASE),align_params)(multi,
77
60
            FN(APPLY_DOM,get_space)(set));
78
60
  set = 
FN60
(APPLY_DOM,align_params)(set,
FN60
(MULTI(BASE),get_space)(multi));
79
60
  return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi, set, fn);
80
0
error:
81
0
  FN(MULTI(BASE),free)(multi);
82
0
  FN(APPLY_DOM,free)(set);
83
0
  return NULL;
84
228
}
isl_aff.c:isl_multi_pw_aff_apply_set
Line
Count
Source
58
4
{
59
4
  isl_bool aligned;
60
4
  isl_ctx *ctx;
61
4
62
4
  if (
!multi || 4
!set4
)
63
0
    goto error;
64
4
65
4
  
aligned = 4
FN4
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
4
  if (aligned < 0)
67
0
    goto error;
68
4
  
if (4
aligned4
)
69
4
    
return 4
FN4
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
4
                    set, fn);
71
0
  
ctx = 0
FN0
(MULTI(BASE),get_ctx)(multi);
72
0
  if (!isl_space_has_named_params(multi->space) ||
73
0
      !isl_space_has_named_params(set->dim))
74
0
    isl_die(ctx, isl_error_invalid,
75
0
      "unaligned unnamed parameters", goto error);
76
0
  
multi = 0
FN0
(MULTI(BASE),align_params)(multi,
77
0
            FN(APPLY_DOM,get_space)(set));
78
0
  set = 
FN0
(APPLY_DOM,align_params)(set,
FN0
(MULTI(BASE),get_space)(multi));
79
0
  return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi, set, fn);
80
0
error:
81
0
  FN(MULTI(BASE),free)(multi);
82
0
  FN(APPLY_DOM,free)(set);
83
0
  return NULL;
84
4
}
isl_aff.c:isl_multi_aff_apply_set
Line
Count
Source
58
2.76k
{
59
2.76k
  isl_bool aligned;
60
2.76k
  isl_ctx *ctx;
61
2.76k
62
2.76k
  if (
!multi || 2.76k
!set2.76k
)
63
0
    goto error;
64
2.76k
65
2.76k
  
aligned = 2.76k
FN2.76k
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
2.76k
  if (aligned < 0)
67
0
    goto error;
68
2.76k
  
if (2.76k
aligned2.76k
)
69
2.76k
    
return 2.76k
FN2.76k
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
2.76k
                    set, fn);
71
0
  
ctx = 0
FN0
(MULTI(BASE),get_ctx)(multi);
72
0
  if (!isl_space_has_named_params(multi->space) ||
73
0
      !isl_space_has_named_params(set->dim))
74
0
    isl_die(ctx, isl_error_invalid,
75
0
      "unaligned unnamed parameters", goto error);
76
0
  
multi = 0
FN0
(MULTI(BASE),align_params)(multi,
77
0
            FN(APPLY_DOM,get_space)(set));
78
0
  set = 
FN0
(APPLY_DOM,align_params)(set,
FN0
(MULTI(BASE),get_space)(multi));
79
0
  return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi, set, fn);
80
0
error:
81
0
  FN(MULTI(BASE),free)(multi);
82
0
  FN(APPLY_DOM,free)(set);
83
0
  return NULL;
84
2.76k
}