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) {


        
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to