Coverage Report

Created: 2017-03-28 09:59

/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
1.84k
{
22
1.84k
  int i;
23
1.84k
24
1.84k
  if (
!multi || 1.84k
!set1.84k
)
25
0
    goto error;
26
1.84k
27
1.84k
  
if (1.84k
multi->n == 01.84k
)
{42
28
42
    FN(APPLY_DOM,free)(set);
29
42
    return multi;
30
42
  }
31
1.84k
32
1.80k
  
multi = 1.80k
FN1.80k
(MULTI(BASE),cow)(multi);
33
1.80k
  if (!multi)
34
0
    goto error;
35
1.80k
36
5.34k
  
for (i = 0; 1.80k
i < multi->n5.34k
;
++i3.54k
)
{3.54k
37
3.54k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
3.54k
    if (!multi->p[i])
39
0
      goto error;
40
3.54k
  }
41
1.80k
42
1.80k
  
FN1.80k
(APPLY_DOM,free)(set);1.80k
43
1.80k
  return multi;
44
0
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
1.80k
}
isl_multi_aff_apply_aligned_set
Line
Count
Source
21
1.65k
{
22
1.65k
  int i;
23
1.65k
24
1.65k
  if (
!multi || 1.65k
!set1.65k
)
25
0
    goto error;
26
1.65k
27
1.65k
  
if (1.65k
multi->n == 01.65k
)
{42
28
42
    FN(APPLY_DOM,free)(set);
29
42
    return multi;
30
42
  }
31
1.65k
32
1.61k
  
multi = 1.61k
FN1.61k
(MULTI(BASE),cow)(multi);
33
1.61k
  if (!multi)
34
0
    goto error;
35
1.61k
36
4.97k
  
for (i = 0; 1.61k
i < multi->n4.97k
;
++i3.35k
)
{3.35k
37
3.35k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
3.35k
    if (!multi->p[i])
39
0
      goto error;
40
3.35k
  }
41
1.61k
42
1.61k
  
FN1.61k
(APPLY_DOM,free)(set);1.61k
43
1.61k
  return multi;
44
0
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
1.61k
}
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
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
)
{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
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
182
{
22
182
  int i;
23
182
24
182
  if (
!multi || 182
!set182
)
25
0
    goto error;
26
182
27
182
  
if (182
multi->n == 0182
)
{0
28
0
    FN(APPLY_DOM,free)(set);
29
0
    return multi;
30
0
  }
31
182
32
182
  
multi = 182
FN182
(MULTI(BASE),cow)(multi);
33
182
  if (!multi)
34
0
    goto error;
35
182
36
364
  
for (i = 0; 182
i < multi->n364
;
++i182
)
{182
37
182
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
182
    if (!multi->p[i])
39
0
      goto error;
40
182
  }
41
182
42
182
  
FN182
(APPLY_DOM,free)(set);182
43
182
  return multi;
44
0
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
182
}
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
1.84k
{
59
1.84k
  isl_bool aligned;
60
1.84k
  isl_ctx *ctx;
61
1.84k
62
1.84k
  if (
!multi || 1.84k
!set1.84k
)
63
0
    goto error;
64
1.84k
65
1.84k
  
aligned = 1.84k
FN1.84k
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
1.84k
  if (aligned < 0)
67
0
    goto error;
68
1.84k
  
if (1.84k
aligned1.84k
)
69
1.79k
    
return 1.79k
FN1.79k
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
1.79k
                    set, fn);
71
45
  
ctx = 45
FN45
(MULTI(BASE),get_ctx)(multi);
72
45
  if (!isl_space_has_named_params(multi->space) ||
73
45
      !isl_space_has_named_params(set->dim))
74
0
    isl_die(ctx, isl_error_invalid,
75
45
      "unaligned unnamed parameters", goto error);
76
45
  
multi = 45
FN45
(MULTI(BASE),align_params)(multi,
77
45
            FN(APPLY_DOM,get_space)(set));
78
45
  set = 
FN45
(APPLY_DOM,align_params)(set,
FN45
(MULTI(BASE),get_space)(multi));
79
45
  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
45
}
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
182
{
59
182
  isl_bool aligned;
60
182
  isl_ctx *ctx;
61
182
62
182
  if (
!multi || 182
!set182
)
63
0
    goto error;
64
182
65
182
  
aligned = 182
FN182
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
182
  if (aligned < 0)
67
0
    goto error;
68
182
  
if (182
aligned182
)
69
137
    
return 137
FN137
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
137
                    set, fn);
71
45
  
ctx = 45
FN45
(MULTI(BASE),get_ctx)(multi);
72
45
  if (!isl_space_has_named_params(multi->space) ||
73
45
      !isl_space_has_named_params(set->dim))
74
0
    isl_die(ctx, isl_error_invalid,
75
45
      "unaligned unnamed parameters", goto error);
76
45
  
multi = 45
FN45
(MULTI(BASE),align_params)(multi,
77
45
            FN(APPLY_DOM,get_space)(set));
78
45
  set = 
FN45
(APPLY_DOM,align_params)(set,
FN45
(MULTI(BASE),get_space)(multi));
79
45
  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
45
}
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
0
}
isl_aff.c:isl_multi_aff_apply_set
Line
Count
Source
58
1.65k
{
59
1.65k
  isl_bool aligned;
60
1.65k
  isl_ctx *ctx;
61
1.65k
62
1.65k
  if (
!multi || 1.65k
!set1.65k
)
63
0
    goto error;
64
1.65k
65
1.65k
  
aligned = 1.65k
FN1.65k
(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
1.65k
  if (aligned < 0)
67
0
    goto error;
68
1.65k
  
if (1.65k
aligned1.65k
)
69
1.65k
    
return 1.65k
FN1.65k
(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
1.65k
                    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
0
}