Coverage Report

Created: 2017-08-21 19:50

/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
2.47k
{
22
2.47k
  int i;
23
2.47k
24
2.47k
  if (
!multi || 2.47k
!set2.47k
)
25
0
    goto error;
26
2.47k
27
2.47k
  
if (2.47k
multi->n == 02.47k
)
{41
28
41
    FN(APPLY_DOM,free)(set);
29
41
    return multi;
30
2.47k
  }
31
2.47k
32
2.43k
  
multi = 2.43k
FN2.43k
(MULTI(BASE),cow)(multi);
33
2.43k
  if (!multi)
34
0
    goto error;
35
2.43k
36
7.66k
  
for (i = 0; 2.43k
i < multi->n7.66k
;
++i5.23k
)
{5.23k
37
5.23k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
5.23k
    if (!multi->p[i])
39
0
      goto error;
40
5.23k
  }
41
2.43k
42
2.43k
  
FN2.43k
(APPLY_DOM,free)(set);2.43k
43
2.43k
  return multi;
44
2.43k
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
2.43k
  return NULL;
48
2.47k
}
isl_multi_aff_apply_aligned_set
Line
Count
Source
21
2.27k
{
22
2.27k
  int i;
23
2.27k
24
2.27k
  if (
!multi || 2.27k
!set2.27k
)
25
0
    goto error;
26
2.27k
27
2.27k
  
if (2.27k
multi->n == 02.27k
)
{41
28
41
    FN(APPLY_DOM,free)(set);
29
41
    return multi;
30
2.27k
  }
31
2.27k
32
2.22k
  
multi = 2.22k
FN2.22k
(MULTI(BASE),cow)(multi);
33
2.22k
  if (!multi)
34
0
    goto error;
35
2.22k
36
7.26k
  
for (i = 0; 2.22k
i < multi->n7.26k
;
++i5.03k
)
{5.03k
37
5.03k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
5.03k
    if (!multi->p[i])
39
0
      goto error;
40
5.03k
  }
41
2.22k
42
2.22k
  
FN2.22k
(APPLY_DOM,free)(set);2.22k
43
2.22k
  return multi;
44
2.22k
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
2.22k
  return NULL;
48
2.27k
}
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
)
{0
28
0
    FN(APPLY_DOM,free)(set);
29
0
    return multi;
30
4
  }
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
)
{5
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);4
43
4
  return multi;
44
4
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
4
  return NULL;
48
4
}
isl_multi_union_pw_aff_apply_aligned_union_set
Line
Count
Source
21
199
{
22
199
  int i;
23
199
24
199
  if (
!multi || 199
!set199
)
25
0
    goto error;
26
199
27
199
  
if (199
multi->n == 0199
)
{0
28
0
    FN(APPLY_DOM,free)(set);
29
0
    return multi;
30
199
  }
31
199
32
199
  
multi = 199
FN199
(MULTI(BASE),cow)(multi);
33
199
  if (!multi)
34
0
    goto error;
35
199
36
398
  
for (i = 0; 199
i < multi->n398
;
++i199
)
{199
37
199
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
199
    if (!multi->p[i])
39
0
      goto error;
40
199
  }
41
199
42
199
  
FN199
(APPLY_DOM,free)(set);199
43
199
  return multi;
44
199
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
199
  return NULL;
48
199
}
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
2.47k
{
59
2.47k
  isl_bool aligned;
60
2.47k
  isl_ctx *ctx;
61
2.47k
62
2.47k
  if (
!multi || 2.47k
!set2.47k
)
63
0
    goto error;
64
2.47k
65
2.47k
  
aligned = 2.47k
FN2.47k
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
2.47k
  if (aligned < 0)
67
0
    goto error;
68
2.47k
  
if (2.47k
aligned2.47k
)
69
2.41k
    
return 2.41k
FN2.41k
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
2.47k
                    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
60
error:
81
0
  FN(MULTI(BASE),free)(multi);
82
0
  FN(APPLY_DOM,free)(set);
83
60
  return NULL;
84
2.47k
}
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
199
{
59
199
  isl_bool aligned;
60
199
  isl_ctx *ctx;
61
199
62
199
  if (
!multi || 199
!set199
)
63
0
    goto error;
64
199
65
199
  
aligned = 199
FN199
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
199
  if (aligned < 0)
67
0
    goto error;
68
199
  
if (199
aligned199
)
69
139
    
return 139
FN139
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
199
                    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
60
error:
81
0
  FN(MULTI(BASE),free)(multi);
82
0
  FN(APPLY_DOM,free)(set);
83
60
  return NULL;
84
199
}
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.27k
{
59
2.27k
  isl_bool aligned;
60
2.27k
  isl_ctx *ctx;
61
2.27k
62
2.27k
  if (
!multi || 2.27k
!set2.27k
)
63
0
    goto error;
64
2.27k
65
2.27k
  
aligned = 2.27k
FN2.27k
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
2.27k
  if (aligned < 0)
67
0
    goto error;
68
2.27k
  
if (2.27k
aligned2.27k
)
69
2.27k
    
return 2.27k
FN2.27k
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
2.27k
                    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.27k
}