diff options
author | David Green <david.green@arm.com> | 2018-02-28 11:00:08 +0000 |
---|---|---|
committer | David Green <david.green@arm.com> | 2018-02-28 11:00:08 +0000 |
commit | 7c35de124abd754b8e98f67be848a37c0b8d975e (patch) | |
tree | 11f0b4013f548bc9ff1243cadb7429a0e64b671f /llvm/lib/CodeGen/MachineDominators.cpp | |
parent | a94a4308e1bccddfa76d7836ad6c2ddf401caa09 (diff) | |
download | bcm5719-llvm-7c35de124abd754b8e98f67be848a37c0b8d975e.tar.gz bcm5719-llvm-7c35de124abd754b8e98f67be848a37c0b8d975e.zip |
[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
llvm-svn: 326315
Diffstat (limited to 'llvm/lib/CodeGen/MachineDominators.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineDominators.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/MachineDominators.cpp b/llvm/lib/CodeGen/MachineDominators.cpp index 517ac29b645..6b280262645 100644 --- a/llvm/lib/CodeGen/MachineDominators.cpp +++ b/llvm/lib/CodeGen/MachineDominators.cpp @@ -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::applySplitCriticalEdges() const { 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(); - } -} |