[llvm] r326315 - [Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees

David Green via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 03:00:09 PST 2018


Author: dmgreen
Date: Wed Feb 28 03:00:08 2018
New Revision: 326315

URL: http://llvm.org/viewvc/llvm-project?rev=326315&view=rev
Log:
[Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees

Removes verifyDomTree, using assert(verify()) everywhere instead, and
changes verify a little to always run IsSameAsFreshTree first in order
to print good output when we find errors. Also adds verifyAnalysis for
PostDomTrees, which will allow checking of PostDomTrees it the same way
we check DomTrees and MachineDomTrees.

Differential Revision: https://reviews.llvm.org/D41298


Modified:
    llvm/trunk/include/llvm/Analysis/PostDominators.h
    llvm/trunk/include/llvm/CodeGen/MachineDominators.h
    llvm/trunk/include/llvm/IR/Dominators.h
    llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
    llvm/trunk/lib/Analysis/PostDominators.cpp
    llvm/trunk/lib/CodeGen/MachineDominators.cpp
    llvm/trunk/lib/IR/Dominators.cpp
    llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp
    llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
    llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
    llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
    llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp
    llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
    llvm/trunk/unittests/IR/DominatorTreeTest.cpp
    llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp

Modified: llvm/trunk/include/llvm/Analysis/PostDominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/PostDominators.h?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/PostDominators.h (original)
+++ llvm/trunk/include/llvm/Analysis/PostDominators.h Wed Feb 28 03:00:08 2018
@@ -76,6 +76,8 @@ struct PostDominatorTreeWrapperPass : pu
 
   bool runOnFunction(Function &F) override;
 
+  void verifyAnalysis() const override;
+
   void getAnalysisUsage(AnalysisUsage &AU) const override {
     AU.setPreservesAll();
   }

Modified: llvm/trunk/include/llvm/CodeGen/MachineDominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineDominators.h?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineDominators.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineDominators.h Wed Feb 28 03:00:08 2018
@@ -249,12 +249,6 @@ public:
            "A basic block inserted via edge splitting cannot appear twice");
     CriticalEdgesToSplit.push_back({FromBB, ToBB, NewBB});
   }
-
-  /// \brief Verify the correctness of the domtree by re-computing it.
-  ///
-  /// This should only be used for debugging as it aborts the program if the
-  /// verification fails.
-  void verifyDomTree() const;
 };
 
 //===-------------------------------------

Modified: llvm/trunk/include/llvm/IR/Dominators.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Dominators.h?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Dominators.h (original)
+++ llvm/trunk/include/llvm/IR/Dominators.h Wed Feb 28 03:00:08 2018
@@ -174,12 +174,6 @@ class DominatorTree : public DominatorTr
   /// \brief Provide an overload for a Use.
   bool isReachableFromEntry(const Use &U) const;
 
-  /// \brief Verify the correctness of the domtree by re-computing it.
-  ///
-  /// This should only be used for debugging as it aborts the program if the
-  /// verification fails.
-  void verifyDomTree() const;
-
   // Pop up a GraphViz/gv window with the Dominator Tree rendered using `dot`.
   void viewGraph(const Twine &Name, const Twine &Title);
   void viewGraph();

Modified: llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h (original)
+++ llvm/trunk/include/llvm/Support/GenericDomTreeConstruction.h Wed Feb 28 03:00:08 2018
@@ -1602,7 +1602,8 @@ struct SemiNCAInfo {
     const bool Different = DT.compare(FreshTree);
 
     if (Different) {
-      errs() << "DominatorTree is different than a freshly computed one!\n"
+      errs() << (DT.isPostDominator() ? "Post" : "")
+             << "DominatorTree is different than a freshly computed one!\n"
              << "\tCurrent:\n";
       DT.print(errs());
       errs() << "\n\tFreshly computed tree:\n";
@@ -1642,34 +1643,27 @@ void ApplyUpdates(DomTreeT &DT,
 template <class DomTreeT>
 bool Verify(const DomTreeT &DT, typename DomTreeT::VerificationLevel VL) {
   SemiNCAInfo<DomTreeT> SNCA(nullptr);
-  const bool InitialChecks = SNCA.verifyRoots(DT) &&
-                             SNCA.verifyReachability(DT) &&
-                             SNCA.VerifyLevels(DT) && SNCA.VerifyDFSNumbers(DT);
 
-  if (!InitialChecks)
+  // Simplist check is to compare against a new tree. This will also
+  // usefully print the old and new trees, if they are different.
+  if (!SNCA.IsSameAsFreshTree(DT))
     return false;
 
-  switch (VL) {
-  case DomTreeT::VerificationLevel::Fast:
-    return SNCA.IsSameAsFreshTree(DT);
-
-  case DomTreeT::VerificationLevel::Basic:
-    return SNCA.verifyParentProperty(DT) && SNCA.IsSameAsFreshTree(DT);
-
-  case DomTreeT::VerificationLevel::Full: {
-    bool FullRes
-        = SNCA.verifyParentProperty(DT) && SNCA.verifySiblingProperty(DT);
-
-    // Postdominators depend on root selection, make sure that a fresh tree
-    // looks the same.
-    if (DT.isPostDominator())
-      FullRes &= SNCA.IsSameAsFreshTree(DT);
+  // Common checks to verify the properties of the tree. O(N log N) at worst
+  if (!SNCA.verifyRoots(DT) || !SNCA.verifyReachability(DT) ||
+      !SNCA.VerifyLevels(DT) || !SNCA.VerifyDFSNumbers(DT))
+    return false;
 
-    return FullRes;
-  }
-  }
+  // Extra checks depending on VerificationLevel. Up to O(N^3)
+  if (VL == DomTreeT::VerificationLevel::Basic ||
+      VL == DomTreeT::VerificationLevel::Full)
+    if (!SNCA.verifyParentProperty(DT))
+      return false;
+  if (VL == DomTreeT::VerificationLevel::Full)
+    if (!SNCA.verifySiblingProperty(DT))
+      return false;
 
-  llvm_unreachable("Unhandled DomTree VerificationLevel");
+  return true;
 }
 
 }  // namespace DomTreeBuilder

Modified: llvm/trunk/lib/Analysis/PostDominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/PostDominators.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/PostDominators.cpp (original)
+++ llvm/trunk/lib/Analysis/PostDominators.cpp Wed Feb 28 03:00:08 2018
@@ -21,6 +21,12 @@ using namespace llvm;
 
 #define DEBUG_TYPE "postdomtree"
 
+#ifdef EXPENSIVE_CHECKS
+static constexpr bool ExpensiveChecksEnabled = true;
+#else
+static constexpr bool ExpensiveChecksEnabled = false;
+#endif
+
 //===----------------------------------------------------------------------===//
 //  PostDominatorTree Implementation
 //===----------------------------------------------------------------------===//
@@ -44,6 +50,13 @@ bool PostDominatorTreeWrapperPass::runOn
   return false;
 }
 
+void PostDominatorTreeWrapperPass::verifyAnalysis() const {
+  if (VerifyDomInfo)
+    assert(DT.verify(PostDominatorTree::VerificationLevel::Full));
+  else if (ExpensiveChecksEnabled)
+    assert(DT.verify(PostDominatorTree::VerificationLevel::Basic));
+}
+
 void PostDominatorTreeWrapperPass::print(raw_ostream &OS, const Module *) const {
   DT.print(OS);
 }

Modified: llvm/trunk/lib/CodeGen/MachineDominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineDominators.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineDominators.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineDominators.cpp Wed Feb 28 03:00:08 2018
@@ -65,8 +65,21 @@ void MachineDominatorTree::releaseMemory
 }
 
 void MachineDominatorTree::verifyAnalysis() const {
-  if (DT && VerifyMachineDomInfo)
-    verifyDomTree();
+  if (DT && VerifyMachineDomInfo) {
+    MachineFunction &F = *getRoot()->getParent();
+
+    DomTreeBase<MachineBasicBlock> OtherDT;
+    OtherDT.recalculate(F);
+    if (getRootNode()->getBlock() != OtherDT.getRootNode()->getBlock() ||
+        DT->compare(OtherDT)) {
+      errs() << "MachineDominatorTree for function " << F.getName()
+            << " is not up to date!\nComputed:\n";
+      DT->print(errs());
+      errs() << "\nActual:\n";
+      OtherDT.print(errs());
+      abort();
+    }
+  }
 }
 
 void MachineDominatorTree::print(raw_ostream &OS, const Module*) const {
@@ -138,21 +151,3 @@ void MachineDominatorTree::applySplitCri
   NewBBs.clear();
   CriticalEdgesToSplit.clear();
 }
-
-void MachineDominatorTree::verifyDomTree() const {
-  if (!DT)
-    return;
-  MachineFunction &F = *getRoot()->getParent();
-
-  DomTreeBase<MachineBasicBlock> OtherDT;
-  OtherDT.recalculate(F);
-  if (getRootNode()->getBlock() != OtherDT.getRootNode()->getBlock() ||
-      DT->compare(OtherDT)) {
-    errs() << "MachineDominatorTree for function " << F.getName()
-           << " is not up to date!\nComputed:\n";
-    DT->print(errs());
-    errs() << "\nActual:\n";
-    OtherDT.print(errs());
-    abort();
-  }
-}

Modified: llvm/trunk/lib/IR/Dominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Dominators.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Dominators.cpp (original)
+++ llvm/trunk/lib/IR/Dominators.cpp Wed Feb 28 03:00:08 2018
@@ -306,23 +306,6 @@ bool DominatorTree::isReachableFromEntry
   return isReachableFromEntry(I->getParent());
 }
 
-void DominatorTree::verifyDomTree() const {
-  // Perform the expensive checks only when VerifyDomInfo is set.
-  VerificationLevel VL = VerificationLevel::Fast;
-  if (VerifyDomInfo)
-    VL = VerificationLevel::Full;
-  else if (ExpensiveChecksEnabled)
-    VL = VerificationLevel::Basic;
-
-  if (!verify(VL)) {
-    errs() << "\n~~~~~~~~~~~\n\t\tDomTree verification failed!\n~~~~~~~~~~~\n";
-    errs() << "\nCFG:\n";
-    getRoot()->getParent()->print(errs());
-    errs().flush();
-    abort();
-  }
-}
-
 //===----------------------------------------------------------------------===//
 //  DominatorTreeAnalysis and related pass implementations
 //===----------------------------------------------------------------------===//
@@ -353,8 +336,9 @@ PreservedAnalyses DominatorTreePrinterPa
 
 PreservedAnalyses DominatorTreeVerifierPass::run(Function &F,
                                                  FunctionAnalysisManager &AM) {
-  AM.getResult<DominatorTreeAnalysis>(F).verifyDomTree();
-
+  auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
+  assert(DT.verify());
+  (void)DT;
   return PreservedAnalyses::all();
 }
 
@@ -377,8 +361,10 @@ bool DominatorTreeWrapperPass::runOnFunc
 }
 
 void DominatorTreeWrapperPass::verifyAnalysis() const {
-  if (ExpensiveChecksEnabled || VerifyDomInfo)
-    DT.verifyDomTree();
+  if (VerifyDomInfo)
+    assert(DT.verify(DominatorTree::VerificationLevel::Full));
+  else if (ExpensiveChecksEnabled)
+    assert(DT.verify(DominatorTree::VerificationLevel::Basic));
 }
 
 void DominatorTreeWrapperPass::print(raw_ostream &OS, const Module *) const {

Modified: llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopDistribute.cpp Wed Feb 28 03:00:08 2018
@@ -780,7 +780,7 @@ public:
 
     if (LDistVerify) {
       LI->verify(*DT);
-      DT->verifyDomTree();
+      assert(DT->verify(DominatorTree::VerificationLevel::Fast));
     }
 
     ++NumLoopsDistributed;

Modified: llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp Wed Feb 28 03:00:08 2018
@@ -637,7 +637,7 @@ static bool unswitchTrivialSwitch(Loop &
     BranchInst::Create(CommonSuccBB, BB);
   }
 
-  DT.verifyDomTree();
+  assert(DT.verify(DominatorTree::VerificationLevel::Fast));
   ++NumTrivial;
   ++NumSwitches;
   return true;
@@ -2079,11 +2079,9 @@ PreservedAnalyses SimpleLoopUnswitchPass
                     NonTrivialUnswitchCB))
     return PreservedAnalyses::all();
 
-#ifndef NDEBUG
   // Historically this pass has had issues with the dominator tree so verify it
   // in asserts builds.
-  AR.DT.verifyDomTree();
-#endif
+  assert(AR.DT.verify(DominatorTree::VerificationLevel::Fast));
   return getLoopPassPreservedAnalyses();
 }
 
@@ -2147,11 +2145,10 @@ bool SimpleLoopUnswitchLegacyPass::runOn
   // loop.
   LPM.deleteSimpleAnalysisLoop(L);
 
-#ifndef NDEBUG
   // Historically this pass has had issues with the dominator tree so verify it
   // in asserts builds.
-  DT.verifyDomTree();
-#endif
+  assert(DT.verify(DominatorTree::VerificationLevel::Fast));
+
   return Changed;
 }
 

Modified: llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LibCallsShrinkWrap.cpp Wed Feb 28 03:00:08 2018
@@ -529,10 +529,7 @@ static bool runImpl(Function &F, const T
   bool Changed = CCDCE.perform();
 
 // Verify the dominator after we've updated it locally.
-#ifndef NDEBUG
-  if (DT)
-    DT->verifyDomTree();
-#endif
+  assert(!DT || DT->verify(DominatorTree::VerificationLevel::Fast));
   return Changed;
 }
 

Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Wed Feb 28 03:00:08 2018
@@ -769,8 +769,8 @@ LoopUnrollResult llvm::UnrollLoop(
     }
   }
 
-  if (DT && UnrollVerifyDomtree)
-    DT->verifyDomTree();
+  assert(!DT || !UnrollVerifyDomtree ||
+      DT->verify(DominatorTree::VerificationLevel::Fast));
 
   // Merge adjacent basic blocks, if possible.
   SmallPtrSet<Loop *, 4> ForgottenLoops;

Modified: llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp Wed Feb 28 03:00:08 2018
@@ -500,10 +500,7 @@ bool llvm::peelLoop(Loop *L, unsigned Pe
       // the original loop body.
       if (Iter == 0)
         DT->changeImmediateDominator(Exit, cast<BasicBlock>(LVMap[Latch]));
-#ifndef NDEBUG
-      if (VerifyDomInfo)
-        DT->verifyDomTree();
-#endif
+      assert(DT->verify(DominatorTree::VerificationLevel::Fast));
     }
 
     updateBranchWeights(InsertBot, cast<BranchInst>(VMap[LatchBR]), Iter,

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Wed Feb 28 03:00:08 2018
@@ -4779,7 +4779,7 @@ void InnerLoopVectorizer::updateAnalysis
   DT->addNewBlock(LoopScalarPreHeader, LoopBypassBlocks[0]);
   DT->changeImmediateDominator(LoopScalarBody, LoopScalarPreHeader);
   DT->changeImmediateDominator(LoopExitBlock, LoopBypassBlocks[0]);
-  DEBUG(DT->verifyDomTree());
+  assert(DT->verify(DominatorTree::VerificationLevel::Fast));
 }
 
 /// \brief Check whether it is safe to if-convert this phi node.

Modified: llvm/trunk/unittests/IR/DominatorTreeTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/DominatorTreeTest.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/DominatorTreeTest.cpp (original)
+++ llvm/trunk/unittests/IR/DominatorTreeTest.cpp Wed Feb 28 03:00:08 2018
@@ -264,14 +264,14 @@ TEST(DominatorTree, Unreachable) {
         EXPECT_EQ(DT->getNode(BB4)->getLevel(), 1U);
 
         // Change root node
-        DT->verifyDomTree();
+        EXPECT_TRUE(DT->verify());
         BasicBlock *NewEntry =
             BasicBlock::Create(F.getContext(), "new_entry", &F, BB0);
         BranchInst::Create(BB0, NewEntry);
         EXPECT_EQ(F.begin()->getName(), NewEntry->getName());
         EXPECT_TRUE(&F.getEntryBlock() == NewEntry);
         DT->setNewRoot(NewEntry);
-        DT->verifyDomTree();
+        EXPECT_TRUE(DT->verify());
       });
 }
 

Modified: llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp?rev=326315&r1=326314&r2=326315&view=diff
==============================================================================
--- llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp (original)
+++ llvm/trunk/unittests/Transforms/Scalar/LoopPassManagerTest.cpp Wed Feb 28 03:00:08 2018
@@ -962,7 +962,7 @@ TEST_F(LoopPassManagerTest, LoopChildIns
         AR.DT.addNewBlock(NewLoop010PHBB, &Loop01BB);
         AR.DT.addNewBlock(NewLoop010BB, NewLoop010PHBB);
         AR.DT.addNewBlock(NewLoop01LatchBB, NewLoop010BB);
-        AR.DT.verifyDomTree();
+        EXPECT_TRUE(AR.DT.verify());
         L.addBasicBlockToLoop(NewLoop010PHBB, AR.LI);
         NewLoop->addBasicBlockToLoop(NewLoop010BB, AR.LI);
         L.addBasicBlockToLoop(NewLoop01LatchBB, AR.LI);
@@ -1004,7 +1004,7 @@ TEST_F(LoopPassManagerTest, LoopChildIns
         AR.DT.addNewBlock(NewLoop011PHBB, NewLoop010BB);
         auto *NewDTNode = AR.DT.addNewBlock(NewLoop011BB, NewLoop011PHBB);
         AR.DT.changeImmediateDominator(AR.DT[NewLoop01LatchBB], NewDTNode);
-        AR.DT.verifyDomTree();
+        EXPECT_TRUE(AR.DT.verify());
         L.addBasicBlockToLoop(NewLoop011PHBB, AR.LI);
         NewLoop->addBasicBlockToLoop(NewLoop011BB, AR.LI);
         NewLoop->verifyLoop();
@@ -1149,7 +1149,7 @@ TEST_F(LoopPassManagerTest, LoopPeerInse
         AR.DT.addNewBlock(NewLoop01PHBB, &Loop00BB);
         auto *NewDTNode = AR.DT.addNewBlock(NewLoop01BB, NewLoop01PHBB);
         AR.DT.changeImmediateDominator(AR.DT[&Loop02PHBB], NewDTNode);
-        AR.DT.verifyDomTree();
+        EXPECT_TRUE(AR.DT.verify());
         L.getParentLoop()->addBasicBlockToLoop(NewLoop01PHBB, AR.LI);
         NewLoop->addBasicBlockToLoop(NewLoop01BB, AR.LI);
         L.getParentLoop()->verifyLoop();
@@ -1216,7 +1216,7 @@ TEST_F(LoopPassManagerTest, LoopPeerInse
         AR.DT.addNewBlock(NewLoop040PHBB, NewLoop04BB);
         AR.DT.addNewBlock(NewLoop040BB, NewLoop040PHBB);
         AR.DT.addNewBlock(NewLoop04LatchBB, NewLoop040BB);
-        AR.DT.verifyDomTree();
+        EXPECT_TRUE(AR.DT.verify());
         L.getParentLoop()->addBasicBlockToLoop(NewLoop03PHBB, AR.LI);
         NewLoops[0]->addBasicBlockToLoop(NewLoop03BB, AR.LI);
         L.getParentLoop()->addBasicBlockToLoop(NewLoop04PHBB, AR.LI);
@@ -1271,7 +1271,7 @@ TEST_F(LoopPassManagerTest, LoopPeerInse
         AR.DT.addNewBlock(NewLoop1PHBB, &Loop0BB);
         auto *NewDTNode = AR.DT.addNewBlock(NewLoop1BB, NewLoop1PHBB);
         AR.DT.changeImmediateDominator(AR.DT[&Loop2PHBB], NewDTNode);
-        AR.DT.verifyDomTree();
+        EXPECT_TRUE(AR.DT.verify());
         NewLoop->addBasicBlockToLoop(NewLoop1BB, AR.LI);
         NewLoop->verifyLoop();
         Updater.addSiblingLoops({NewLoop});
@@ -1508,7 +1508,7 @@ TEST_F(LoopPassManagerTest, LoopDeletion
             AR.DT.addNewBlock(NewLoop03BB, NewLoop03PHBB);
             AR.DT.changeImmediateDominator(AR.DT[&Loop0LatchBB],
                                            AR.DT[NewLoop03BB]);
-            AR.DT.verifyDomTree();
+            EXPECT_TRUE(AR.DT.verify());
             ParentL->addBasicBlockToLoop(NewLoop03PHBB, AR.LI);
             NewSibling->addBasicBlockToLoop(NewLoop03BB, AR.LI);
             NewSibling->verifyLoop();




More information about the llvm-commits mailing list