From 551103692acb2dfe9e30edd8318505158e5ed734 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. git-svn-id: https://llvm.org/svn/llvm-project/polly/trunk@301284 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/DeLICM/DeLICMTest.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/unittests/DeLICM/DeLICMTest.cpp b/unittests/DeLICM/DeLICMTest.cpp index 23d3ac09..6fa3f588 100644 --- a/unittests/DeLICM/DeLICMTest.cpp +++ b/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.11.4.GIT