[polly] r301284 - [unittests] Derive Occupied from Unused when given.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 17:30:42 PDT 2017


Author: meinersbur
Date: Mon Apr 24 19:30:42 2017
New Revision: 301284

URL: http://llvm.org/viewvc/llvm-project?rev=301284&view=rev
Log:
[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.

Modified:
    polly/trunk/unittests/DeLICM/DeLICMTest.cpp

Modified: polly/trunk/unittests/DeLICM/DeLICMTest.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/unittests/DeLICM/DeLICMTest.cpp?rev=301284&r1=301283&r2=301284&view=diff
==============================================================================
--- polly/trunk/unittests/DeLICM/DeLICMTest.cpp (original)
+++ polly/trunk/unittests/DeLICM/DeLICMTest.cpp Mon Apr 24 19:30:42 2017
@@ -38,12 +38,19 @@ void completeLifetime(isl::union_set Uni
                       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 Uni
     });
   }
 
-  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()));




More information about the llvm-commits mailing list