Coverage Report

Created: 2017-11-23 03:11

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/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.02k
{
22
3.02k
  int i;
23
3.02k
24
3.02k
  if (!multi || !set)
25
0
    goto error;
26
3.02k
27
3.02k
  if (multi->n == 0) {
28
49
    FN(APPLY_DOM,free)(set);
29
49
    return multi;
30
49
  }
31
2.97k
32
2.97k
  multi = FN(MULTI(BASE),cow)(multi);
33
2.97k
  if (!multi)
34
0
    goto error;
35
2.97k
36
9.65k
  
for (i = 0; 2.97k
i < multi->n;
++i6.67k
) {
37
6.67k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
6.67k
    if (!multi->p[i])
39
0
      goto error;
40
6.67k
  }
41
2.97k
42
2.97k
  FN(APPLY_DOM,free)(set);
43
2.97k
  return multi;
44
2.97k
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
3.02k
}
isl_multi_aff_apply_aligned_set
Line
Count
Source
21
2.77k
{
22
2.77k
  int i;
23
2.77k
24
2.77k
  if (!multi || !set)
25
0
    goto error;
26
2.77k
27
2.77k
  if (multi->n == 0) {
28
49
    FN(APPLY_DOM,free)(set);
29
49
    return multi;
30
49
  }
31
2.73k
32
2.73k
  multi = FN(MULTI(BASE),cow)(multi);
33
2.73k
  if (!multi)
34
0
    goto error;
35
2.73k
36
9.16k
  
for (i = 0; 2.73k
i < multi->n;
++i6.43k
) {
37
6.43k
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
6.43k
    if (!multi->p[i])
39
0
      goto error;
40
6.43k
  }
41
2.73k
42
2.73k
  FN(APPLY_DOM,free)(set);
43
2.73k
  return multi;
44
2.73k
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
2.77k
}
isl_multi_pw_aff_apply_aligned_set
Line
Count
Source
21
4
{
22
4
  int i;
23
4
24
4
  if (!multi || !set)
25
0
    goto error;
26
4
27
4
  if (multi->n == 0) {
28
0
    FN(APPLY_DOM,free)(set);
29
0
    return multi;
30
0
  }
31
4
32
4
  multi = FN(MULTI(BASE),cow)(multi);
33
4
  if (!multi)
34
0
    goto error;
35
4
36
9
  
for (i = 0; 4
i < multi->n;
++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
  FN(APPLY_DOM,free)(set);
43
4
  return multi;
44
4
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
4
}
Unexecuted instantiation: isl_multi_union_pw_aff_apply_aligned_set
isl_multi_union_pw_aff_apply_aligned_union_set
Line
Count
Source
21
240
{
22
240
  int i;
23
240
24
240
  if (!multi || !set)
25
0
    goto error;
26
240
27
240
  if (multi->n == 0) {
28
0
    FN(APPLY_DOM,free)(set);
29
0
    return multi;
30
0
  }
31
240
32
240
  multi = FN(MULTI(BASE),cow)(multi);
33
240
  if (!multi)
34
0
    goto error;
35
240
36
480
  
for (i = 0; 240
i < multi->n;
++i240
) {
37
240
    multi->p[i] = fn(multi->p[i], FN(APPLY_DOM,copy)(set));
38
240
    if (!multi->p[i])
39
0
      goto error;
40
240
  }
41
240
42
240
  FN(APPLY_DOM,free)(set);
43
240
  return multi;
44
240
error:
45
0
  FN(APPLY_DOM,free)(set);
46
0
  FN(MULTI(BASE),free)(multi);
47
0
  return NULL;
48
240
}
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.02k
{
59
3.02k
  isl_bool aligned;
60
3.02k
  isl_ctx *ctx;
61
3.02k
62
3.02k
  if (!multi || !set)
63
0
    goto error;
64
3.02k
65
3.02k
  aligned = FN(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
3.02k
  if (aligned < 0)
67
0
    goto error;
68
3.02k
  if (aligned)
69
2.96k
    return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
2.96k
                    set, fn);
71
60
  ctx = FN(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
60
    
isl_die0
(ctx, isl_error_invalid,
75
60
      "unaligned unnamed parameters", goto error);
76
60
  multi = FN(MULTI(BASE),align_params)(multi,
77
60
            FN(APPLY_DOM,get_space)(set));
78
60
  set = FN(APPLY_DOM,align_params)(set, FN(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
0
  return NULL;
84
3.02k
}
isl_aff.c:isl_multi_aff_apply_set
Line
Count
Source
58
2.77k
{
59
2.77k
  isl_bool aligned;
60
2.77k
  isl_ctx *ctx;
61
2.77k
62
2.77k
  if (!multi || !set)
63
0
    goto error;
64
2.77k
65
2.77k
  aligned = FN(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
2.77k
  if (aligned < 0)
67
0
    goto error;
68
2.77k
  if (aligned)
69
2.77k
    return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
2.77k
                    set, fn);
71
0
  ctx = FN(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 = FN(MULTI(BASE),align_params)(multi,
77
0
            FN(APPLY_DOM,get_space)(set));
78
0
  set = FN(APPLY_DOM,align_params)(set, FN(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.77k
}
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 || !set)
63
0
    goto error;
64
4
65
4
  aligned = FN(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
4
  if (aligned < 0)
67
0
    goto error;
68
4
  if (aligned)
69
4
    return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
4
                    set, fn);
71
0
  ctx = FN(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 = FN(MULTI(BASE),align_params)(multi,
77
0
            FN(APPLY_DOM,get_space)(set));
78
0
  set = FN(APPLY_DOM,align_params)(set, FN(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_union_pw_aff_apply_union_set
Line
Count
Source
58
240
{
59
240
  isl_bool aligned;
60
240
  isl_ctx *ctx;
61
240
62
240
  if (!multi || !set)
63
0
    goto error;
64
240
65
240
  aligned = FN(APPLY_DOM,space_has_equal_params)(set, multi->space);
66
240
  if (aligned < 0)
67
0
    goto error;
68
240
  if (aligned)
69
180
    return FN(FN(MULTI(BASE),apply_aligned),APPLY_DOMBASE)(multi,
70
180
                    set, fn);
71
60
  ctx = FN(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
60
    
isl_die0
(ctx, isl_error_invalid,
75
60
      "unaligned unnamed parameters", goto error);
76
60
  multi = FN(MULTI(BASE),align_params)(multi,
77
60
            FN(APPLY_DOM,get_space)(set));
78
60
  set = FN(APPLY_DOM,align_params)(set, FN(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
0
  return NULL;
84
240
}
Unexecuted instantiation: isl_aff.c:isl_multi_union_pw_aff_apply_set