[unittests/DeLICM] Add test for Occipied vs Occupied.
authorMichael Kruse <llvm@meinersbur.de>
Wed, 26 Apr 2017 21:52:51 +0000 (21:52 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Wed, 26 Apr 2017 21:52:51 +0000 (21:52 +0000)
The interpretation of multiple known ValInsts for the same element and
timepoint is that these are alterntivate names for the same values,
for instance a PHINode and the incoming value when knowning it was
the last executed block. That means that known values do not conflict
if there at least (but necessarily all) one common ValInst.

Add a case to test this principle.

llvm-svn: 301480

polly/unittests/DeLICM/DeLICMTest.cpp

index 0ca3576..4e775a8 100644 (file)
@@ -250,6 +250,9 @@ TEST(DeLICM, isConflicting) {
                                       {"{ Dom[i] -> [] }", nullptr, "{}"}));
   EXPECT_FALSE(checkIsConflictingKnown({"{ Dom[0] -> Val[] }", nullptr, "{}"},
                                        {nullptr, "{ Dom[0] }", "{}"}));
+  EXPECT_FALSE(checkIsConflictingKnown(
+      {"{ Dom[i] -> Val[]; Dom[i] -> Phi[] }", nullptr, "{}"},
+      {"{ Dom[i] -> Val[] }", nullptr, "{}"}));
 
   // An implementation using subtract would have exponential runtime on patterns
   // such as this one.