diff options
author | Jakub Kuderski <kubakuderski@gmail.com> | 2019-09-27 19:33:39 +0000 |
---|---|---|
committer | Jakub Kuderski <kubakuderski@gmail.com> | 2019-09-27 19:33:39 +0000 |
commit | 159ef37735f21ae373282e0c53cbd9b6af1e0dfd (patch) | |
tree | 9b00f274da9fdd7e2e18669c2619a17c5bf59b57 /llvm/lib/CodeGen/MachineDominators.cpp | |
parent | 9bccdfcd4c4ff34f758c0406139c5e40b9b5f32a (diff) | |
download | bcm5719-llvm-159ef37735f21ae373282e0c53cbd9b6af1e0dfd.tar.gz bcm5719-llvm-159ef37735f21ae373282e0c53cbd9b6af1e0dfd.zip |
Revert [Dominators][CodeGen] Clean up MachineDominators
This reverts r373101 (git commit 72c57ec3e6b320c31274dadb888dc16772b8e7b6)
llvm-svn: 373117
Diffstat (limited to 'llvm/lib/CodeGen/MachineDominators.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineDominators.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineDominators.cpp b/llvm/lib/CodeGen/MachineDominators.cpp index a7d7b6e66a0..1dfba8638c2 100644 --- a/llvm/lib/CodeGen/MachineDominators.cpp +++ b/llvm/lib/CodeGen/MachineDominators.cpp @@ -64,11 +64,21 @@ void MachineDominatorTree::releaseMemory() { } void MachineDominatorTree::verifyAnalysis() const { - if (DT && VerifyMachineDomInfo) - if (!DT->verify(DomTreeT::VerificationLevel::Basic)) { - errs() << "MachineDominatorTree verification failed\n"; + 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 { |