[DomTree] verifyDomTree to unconditionally perform DT verification
I folded the check for the flag -verify-dom-info into the only caller where I think it is supposed to be checked: verifyAnalysis. (The idea of the flag is to enable this expensive verification in verifyPreservedAnalysis.) I'm assuming that when manually scheduling the verification pass with -passes=verify<domtree>, we do want to perform the verification. llvm-svn: 236575
This commit is contained in:
parent
f2453a01fb
commit
e340f851a3
|
@ -282,9 +282,6 @@ bool DominatorTree::isReachableFromEntry(const Use &U) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DominatorTree::verifyDomTree() const {
|
void DominatorTree::verifyDomTree() const {
|
||||||
if (!VerifyDomInfo)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Function &F = *getRoot()->getParent();
|
Function &F = *getRoot()->getParent();
|
||||||
|
|
||||||
DominatorTree OtherDT;
|
DominatorTree OtherDT;
|
||||||
|
@ -350,7 +347,10 @@ bool DominatorTreeWrapperPass::runOnFunction(Function &F) {
|
||||||
return false;
|
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 {
|
void DominatorTreeWrapperPass::print(raw_ostream &OS, const Module *) const {
|
||||||
DT.print(OS);
|
DT.print(OS);
|
||||||
|
|
|
@ -455,10 +455,9 @@ static Instruction *findLocationForEntrySafepoint(Function &F,
|
||||||
// Note: SplitBlock modifies the DT. Simply passing a Pass (which is a
|
// Note: SplitBlock modifies the DT. Simply passing a Pass (which is a
|
||||||
// module pass) is not enough.
|
// module pass) is not enough.
|
||||||
DT.recalculate(F);
|
DT.recalculate(F);
|
||||||
#ifndef NDEBUG
|
|
||||||
// SplitBlock updates the DT
|
// SplitBlock updates the DT
|
||||||
DT.verifyDomTree();
|
DEBUG(DT.verifyDomTree());
|
||||||
#endif
|
|
||||||
|
|
||||||
return BB->getTerminator();
|
return BB->getTerminator();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue