Coverage Report

Created: 2018-04-25 16:10

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/polly/lib/External/isl/isl_union_eval.c
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2010      INRIA Saclay
3
 *
4
 * Use of this software is governed by the MIT license
5
 *
6
 * Written by Sven Verdoolaege, INRIA Saclay - Ile-de-France,
7
 * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
8
 * 91893 Orsay, France
9
 */
10
11
#include <isl_union_macro.h>
12
13
/* Evaluate "u" in the void point "pnt".
14
 * In particular, return the value NaN.
15
 */
16
static __isl_give isl_val *FN(UNION,eval_void)(__isl_take UNION *u,
17
  __isl_take isl_point *pnt)
18
0
{
19
0
  isl_ctx *ctx;
20
0
21
0
  ctx = isl_point_get_ctx(pnt);
22
0
  FN(UNION,free)(u);
23
0
  isl_point_free(pnt);
24
0
  return isl_val_nan(ctx);
25
0
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_eval_void
Unexecuted instantiation: isl_polynomial.c:isl_union_pw_qpolynomial_eval_void
26
27
/* Is the domain space of "entry" equal to "space"?
28
 */
29
static int FN(UNION,has_domain_space)(const void *entry, const void *val)
30
1
{
31
1
  PART *part = (PART *)entry;
32
1
  isl_space *space = (isl_space *) val;
33
1
34
1
  if (isl_space_is_params(space))
35
0
    return isl_space_is_set(part->dim);
36
1
37
1
  return isl_space_tuple_is_equal(part->dim, isl_dim_in,
38
1
          space, isl_dim_set);
39
1
}
Unexecuted instantiation: isl_fold.c:isl_union_pw_qpolynomial_fold_has_domain_space
isl_polynomial.c:isl_union_pw_qpolynomial_has_domain_space
Line
Count
Source
30
1
{
31
1
  PART *part = (PART *)entry;
32
1
  isl_space *space = (isl_space *) val;
33
1
34
1
  if (isl_space_is_params(space))
35
0
    return isl_space_is_set(part->dim);
36
1
37
1
  return isl_space_tuple_is_equal(part->dim, isl_dim_in,
38
1
          space, isl_dim_set);
39
1
}
40
41
__isl_give isl_val *FN(UNION,eval)(__isl_take UNION *u,
42
  __isl_take isl_point *pnt)
43
1
{
44
1
  uint32_t hash;
45
1
  struct isl_hash_table_entry *entry;
46
1
  isl_bool is_void;
47
1
  isl_space *space;
48
1
  isl_val *v;
49
1
50
1
  if (!u || !pnt)
51
0
    goto error;
52
1
  is_void = isl_point_is_void(pnt);
53
1
  if (is_void < 0)
54
0
    goto error;
55
1
  if (is_void)
56
0
    return FN(UNION,eval_void)(u, pnt);
57
1
58
1
  space = isl_space_copy(pnt->dim);
59
1
  if (!space)
60
0
    goto error;
61
1
  hash = isl_space_get_hash(space);
62
1
  entry = isl_hash_table_find(u->space->ctx, &u->table,
63
1
            hash, &FN(UNION,has_domain_space),
64
1
            space, 0);
65
1
  isl_space_free(space);
66
1
  if (!entry) {
67
0
    v = isl_val_zero(isl_point_get_ctx(pnt));
68
0
    isl_point_free(pnt);
69
1
  } else {
70
1
    v = FN(PART,eval)(FN(PART,copy)(entry->data), pnt);
71
1
  }
72
1
  FN(UNION,free)(u);
73
1
  return v;
74
1
error:
75
0
  FN(UNION,free)(u);
76
0
  isl_point_free(pnt);
77
0
  return NULL;
78
1
}
Unexecuted instantiation: isl_union_pw_qpolynomial_fold_eval
isl_union_pw_qpolynomial_eval
Line
Count
Source
43
1
{
44
1
  uint32_t hash;
45
1
  struct isl_hash_table_entry *entry;
46
1
  isl_bool is_void;
47
1
  isl_space *space;
48
1
  isl_val *v;
49
1
50
1
  if (!u || !pnt)
51
0
    goto error;
52
1
  is_void = isl_point_is_void(pnt);
53
1
  if (is_void < 0)
54
0
    goto error;
55
1
  if (is_void)
56
0
    return FN(UNION,eval_void)(u, pnt);
57
1
58
1
  space = isl_space_copy(pnt->dim);
59
1
  if (!space)
60
0
    goto error;
61
1
  hash = isl_space_get_hash(space);
62
1
  entry = isl_hash_table_find(u->space->ctx, &u->table,
63
1
            hash, &FN(UNION,has_domain_space),
64
1
            space, 0);
65
1
  isl_space_free(space);
66
1
  if (!entry) {
67
0
    v = isl_val_zero(isl_point_get_ctx(pnt));
68
0
    isl_point_free(pnt);
69
1
  } else {
70
1
    v = FN(PART,eval)(FN(PART,copy)(entry->data), pnt);
71
1
  }
72
1
  FN(UNION,free)(u);
73
1
  return v;
74
1
error:
75
0
  FN(UNION,free)(u);
76
0
  isl_point_free(pnt);
77
0
  return NULL;
78
1
}