diff --git a/llvm/lib/IR/Dominators.cpp b/llvm/lib/IR/Dominators.cpp index 9b6ff1eb1366..e3258895ea5e 100644 --- a/llvm/lib/IR/Dominators.cpp +++ b/llvm/lib/IR/Dominators.cpp @@ -282,9 +282,6 @@ bool DominatorTree::isReachableFromEntry(const Use &U) const { } void DominatorTree::verifyDomTree() const { - if (!VerifyDomInfo) - return; - Function &F = *getRoot()->getParent(); DominatorTree OtherDT; @@ -350,7 +347,10 @@ bool DominatorTreeWrapperPass::runOnFunction(Function &F) { return false; } -void DominatorTreeWrapperPass::verifyAnalysis() const { DT.verifyDomTree(); } +void DominatorTreeWrapperPass::verifyAnalysis() const { + if (VerifyDomInfo) + DT.verifyDomTree(); +} void DominatorTreeWrapperPass::print(raw_ostream &OS, const Module *) const { DT.print(OS); diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp index ffed810d823b..08e41c27c5c6 100644 --- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp +++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -455,10 +455,9 @@ static Instruction *findLocationForEntrySafepoint(Function &F, // Note: SplitBlock modifies the DT. Simply passing a Pass (which is a // module pass) is not enough. DT.recalculate(F); -#ifndef NDEBUG + // SplitBlock updates the DT - DT.verifyDomTree(); -#endif + DEBUG(DT.verifyDomTree()); return BB->getTerminator(); }