[unittests/DeLICM] Add test for Written vs Written.
authorMichael Kruse <llvm@meinersbur.de>
Wed, 26 Apr 2017 21:52:55 +0000 (21:52 +0000)
committerMichael Kruse <llvm@meinersbur.de>
Wed, 26 Apr 2017 21:52:55 +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.

This prinviple also applies to Written values. Add a test for this
principle.

llvm-svn: 301481

polly/unittests/DeLICM/DeLICMTest.cpp

index 4e775a8..5bfff53 100644 (file)
@@ -321,5 +321,8 @@ TEST(DeLICM, isConflicting) {
                                       {"{}", nullptr, "{ Dom[0] -> ValB[] }"}));
   EXPECT_TRUE(checkIsConflictingKnown({"{}", nullptr, "{ Dom[0] -> Val[] }"},
                                       {"{}", nullptr, "{ Dom[0] -> [] }"}));
+  EXPECT_FALSE(checkIsConflictingKnown(
+      {"{}", nullptr, "{ Dom[0] -> Val[]}"},
+      {"{}", nullptr, "{ Dom[0] -> Val[]; Dom[0] -> Phi[] }"}));
 }
 } // anonymous namespace