Coverage Report

Created: 2018-05-23 17:40

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/polly/lib/External/isl/isl_multi_align_templ.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2017      Sven Verdoolaege
3
 *
4
 * Use of this software is governed by the MIT license
5
 *
6
 * Written by Sven Verdoolaege,
7
 */
8
9
/* Align the parameters of "multi" and "domain" (if needed) and
10
 * call "fn".
11
 */
12
static __isl_give MULTI(BASE) *FN(FN(MULTI(BASE),align_params),ALIGN_DOMBASE)(
13
  __isl_take MULTI(BASE) *multi, __isl_take ALIGN_DOM *domain,
14
  __isl_give MULTI(BASE) *fn(__isl_take MULTI(BASE) *multi,
15
    __isl_take ALIGN_DOM *domain))
16
321
{
17
321
  isl_bool aligned;
18
321
  isl_bool named;
19
321
  isl_space *dom_space;
20
321
21
321
  aligned = FN(ALIGN_DOM,space_has_equal_params)(domain, multi->space);
22
321
  if (aligned < 0)
23
0
    goto error;
24
321
  if (aligned)
25
311
    return fn(multi, domain);
26
10
27
10
  dom_space = FN(ALIGN_DOM,peek_space)(domain);
28
10
  named = isl_space_has_named_params(multi->space);
29
10
  if (named >= 0 && named)
30
10
    named = isl_space_has_named_params(dom_space);
31
10
  if (named < 0)
32
0
    goto error;
33
10
  if (!named)
34
10
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
35
10
      "unaligned unnamed parameters", goto error);
36
10
  multi = FN(MULTI(BASE),align_params)(multi,
37
10
              FN(ALIGN_DOM,get_space)(domain));
38
10
  domain = FN(ALIGN_DOM,align_params)(domain,
39
10
              FN(MULTI(BASE),get_space)(multi));
40
10
  return fn(multi, domain);
41
10
error:
42
0
  FN(MULTI(BASE),free)(multi);
43
0
  FN(ALIGN_DOM,free)(domain);
44
0
  return NULL;
45
10
}
isl_aff.c:isl_multi_pw_aff_align_params_set
Line
Count
Source
16
167
{
17
167
  isl_bool aligned;
18
167
  isl_bool named;
19
167
  isl_space *dom_space;
20
167
21
167
  aligned = FN(ALIGN_DOM,space_has_equal_params)(domain, multi->space);
22
167
  if (aligned < 0)
23
0
    goto error;
24
167
  if (aligned)
25
167
    return fn(multi, domain);
26
0
27
0
  dom_space = FN(ALIGN_DOM,peek_space)(domain);
28
0
  named = isl_space_has_named_params(multi->space);
29
0
  if (named >= 0 && named)
30
0
    named = isl_space_has_named_params(dom_space);
31
0
  if (named < 0)
32
0
    goto error;
33
0
  if (!named)
34
0
    isl_die(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
35
0
      "unaligned unnamed parameters", goto error);
36
0
  multi = FN(MULTI(BASE),align_params)(multi,
37
0
              FN(ALIGN_DOM,get_space)(domain));
38
0
  domain = FN(ALIGN_DOM,align_params)(domain,
39
0
              FN(MULTI(BASE),get_space)(multi));
40
0
  return fn(multi, domain);
41
0
error:
42
0
  FN(MULTI(BASE),free)(multi);
43
0
  FN(ALIGN_DOM,free)(domain);
44
0
  return NULL;
45
0
}
isl_aff.c:isl_multi_union_pw_aff_align_params_union_set
Line
Count
Source
16
143
{
17
143
  isl_bool aligned;
18
143
  isl_bool named;
19
143
  isl_space *dom_space;
20
143
21
143
  aligned = FN(ALIGN_DOM,space_has_equal_params)(domain, multi->space);
22
143
  if (aligned < 0)
23
0
    goto error;
24
143
  if (aligned)
25
140
    return fn(multi, domain);
26
3
27
3
  dom_space = FN(ALIGN_DOM,peek_space)(domain);
28
3
  named = isl_space_has_named_params(multi->space);
29
3
  if (named >= 0 && named)
30
3
    named = isl_space_has_named_params(dom_space);
31
3
  if (named < 0)
32
0
    goto error;
33
3
  if (!named)
34
3
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
35
3
      "unaligned unnamed parameters", goto error);
36
3
  multi = FN(MULTI(BASE),align_params)(multi,
37
3
              FN(ALIGN_DOM,get_space)(domain));
38
3
  domain = FN(ALIGN_DOM,align_params)(domain,
39
3
              FN(MULTI(BASE),get_space)(multi));
40
3
  return fn(multi, domain);
41
3
error:
42
0
  FN(MULTI(BASE),free)(multi);
43
0
  FN(ALIGN_DOM,free)(domain);
44
0
  return NULL;
45
3
}
isl_aff.c:isl_multi_union_pw_aff_align_params_set
Line
Count
Source
16
11
{
17
11
  isl_bool aligned;
18
11
  isl_bool named;
19
11
  isl_space *dom_space;
20
11
21
11
  aligned = FN(ALIGN_DOM,space_has_equal_params)(domain, multi->space);
22
11
  if (aligned < 0)
23
0
    goto error;
24
11
  if (aligned)
25
4
    return fn(multi, domain);
26
7
27
7
  dom_space = FN(ALIGN_DOM,peek_space)(domain);
28
7
  named = isl_space_has_named_params(multi->space);
29
7
  if (named >= 0 && named)
30
7
    named = isl_space_has_named_params(dom_space);
31
7
  if (named < 0)
32
0
    goto error;
33
7
  if (!named)
34
7
    
isl_die0
(FN(MULTI(BASE),get_ctx)(multi), isl_error_invalid,
35
7
      "unaligned unnamed parameters", goto error);
36
7
  multi = FN(MULTI(BASE),align_params)(multi,
37
7
              FN(ALIGN_DOM,get_space)(domain));
38
7
  domain = FN(ALIGN_DOM,align_params)(domain,
39
7
              FN(MULTI(BASE),get_space)(multi));
40
7
  return fn(multi, domain);
41
7
error:
42
0
  FN(MULTI(BASE),free)(multi);
43
0
  FN(ALIGN_DOM,free)(domain);
44
0
  return NULL;
45
7
}