From a8b0be819ad4ea425634a45af94ea633efa402ba Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Tue, 25 Apr 2017 00:30:42 +0000 Subject: [PATCH] [unittests] Derive Occupied from Unused when given. When both, OccupiedAndKnown and Unused are given, use the former only for the Known values. The relation Unused \union Occupied must always hold. This allows us to specify Known independently of Occupied. It is needed for an artificial test case in https://reviews.llvm.org/D32025. llvm-svn: 301284 --- polly/unittests/DeLICM/DeLICMTest.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/polly/unittests/DeLICM/DeLICMTest.cpp b/polly/unittests/DeLICM/DeLICMTest.cpp index 23d3ac0..6fa3f58 100644 --- a/polly/unittests/DeLICM/DeLICMTest.cpp +++ b/polly/unittests/DeLICM/DeLICMTest.cpp @@ -38,12 +38,19 @@ void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown, isl::union_set &Undef) { auto ParamSpace = give(isl_union_set_get_space(Universe.keep())); - if (OccupiedAndKnown) { + if (Undef && !Occupied) { assert(!Occupied); + Occupied = give(isl_union_set_subtract(Universe.copy(), Undef.copy())); + } + + if (OccupiedAndKnown) { assert(!Known); Known = isl::union_map::empty(ParamSpace); - Occupied = OccupiedAndKnown.domain(); + + if (!Occupied) + Occupied = OccupiedAndKnown.domain(); + OccupiedAndKnown.foreach_map([&Known](isl::map Map) -> isl::stat { if (isl_map_has_tuple_name(Map.keep(), isl_dim_out) != isl_bool_true) return isl::stat::ok; @@ -52,11 +59,6 @@ void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown, }); } - if (!Occupied) { - assert(Undef); - Occupied = give(isl_union_set_subtract(Universe.copy(), Undef.copy())); - } - if (!Undef) { assert(Occupied); Undef = give(isl_union_set_subtract(Universe.copy(), Occupied.copy())); -- 2.7.4