[llvm] 5fe0798 - [Utils] LocalTest: fix SimplifyCFGWithNullAC test to work with `-simplifycfg-require-and-preserve-domtree=1`

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 1 14:01:59 PST 2021


Author: Roman Lebedev
Date: 2021-01-02T01:01:18+03:00
New Revision: 5fe0798dee6e2093aad7be11956c2bcaaf61dc8c

URL: https://github.com/llvm/llvm-project/commit/5fe0798dee6e2093aad7be11956c2bcaaf61dc8c
DIFF: https://github.com/llvm/llvm-project/commit/5fe0798dee6e2093aad7be11956c2bcaaf61dc8c.diff

LOG: [Utils] LocalTest: fix SimplifyCFGWithNullAC test to work with `-simplifycfg-require-and-preserve-domtree=1`

Added: 
    

Modified: 
    llvm/unittests/Transforms/Utils/LocalTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/Transforms/Utils/LocalTest.cpp b/llvm/unittests/Transforms/Utils/LocalTest.cpp
index ece83950955a..a57a18ce0be1 100644
--- a/llvm/unittests/Transforms/Utils/LocalTest.cpp
+++ b/llvm/unittests/Transforms/Utils/LocalTest.cpp
@@ -998,8 +998,12 @@ TEST(Local, SimplifyCFGWithNullAC) {
   }
   ASSERT_TRUE(TestBB);
 
+  DominatorTree DT(F);
+  DomTreeUpdater DTU(DT, DomTreeUpdater::UpdateStrategy::Eager);
+
   // %test.bb is expected to be simplified by FoldCondBranchOnPHI.
-  EXPECT_TRUE(simplifyCFG(TestBB, TTI, /*DTU=*/nullptr, Options));
+  EXPECT_TRUE(simplifyCFG(TestBB, TTI,
+                          RequireAndPreserveDomTree ? &DTU : nullptr, Options));
 }
 
 TEST(Local, CanReplaceOperandWithVariable) {


        


More information about the llvm-commits mailing list