diff options
author | Jakub Kuderski <kubakuderski@gmail.com> | 2019-09-27 17:25:39 +0000 |
---|---|---|
committer | Jakub Kuderski <kubakuderski@gmail.com> | 2019-09-27 17:25:39 +0000 |
commit | 72c57ec3e6b320c31274dadb888dc16772b8e7b6 (patch) | |
tree | ebecfdf95ab0cfdcfe0cb1a5cd0f8d2a9591f7ca /llvm/lib/CodeGen/MachineDominators.cpp | |
parent | 1a55431a033305605d2f3d6888af3aee17452bd3 (diff) | |
download | bcm5719-llvm-72c57ec3e6b320c31274dadb888dc16772b8e7b6.tar.gz bcm5719-llvm-72c57ec3e6b320c31274dadb888dc16772b8e7b6.zip |
[Dominators][CodeGen] Clean up MachineDominators
Summary: This is a cleanup patch for MachineDominatorTree. It would be an NFC, except for replacing custom DomTree verification with the generic one.
Reviewers: tstellar, tpr, nhaehnle, arsenm, NutshellySima, grosser, hliao
Reviewed By: arsenm
Subscribers: wdng, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67976
llvm-svn: 373101
Diffstat (limited to 'llvm/lib/CodeGen/MachineDominators.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineDominators.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/lib/CodeGen/MachineDominators.cpp b/llvm/lib/CodeGen/MachineDominators.cpp index 1dfba8638c2..a7d7b6e66a0 100644 --- a/llvm/lib/CodeGen/MachineDominators.cpp +++ b/llvm/lib/CodeGen/MachineDominators.cpp @@ -64,21 +64,11 @@ void MachineDominatorTree::releaseMemory() { } void MachineDominatorTree::verifyAnalysis() const { - 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()); + if (DT && VerifyMachineDomInfo) + if (!DT->verify(DomTreeT::VerificationLevel::Basic)) { + errs() << "MachineDominatorTree verification failed\n"; abort(); } - } } void MachineDominatorTree::print(raw_ostream &OS, const Module*) const { |