diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-22 20:31:01 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-22 20:31:01 +0000 |
commit | 8bcb0991864975618c09697b1aca10683346d9f0 (patch) | |
tree | 0afab28faa50e5f27698f8dd6c1921fff8d25e39 /contrib/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp | |
parent | b14637d118e110006a149a79b649c5695e7f419a (diff) | |
parent | 1d5ae1026e831016fc29fd927877c86af904481f (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp b/contrib/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp index 1dfba8638c22..706c706d7527 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/MachineDominators.cpp @@ -18,12 +18,15 @@ using namespace llvm; +namespace llvm { // Always verify dominfo if expensive checking is enabled. #ifdef EXPENSIVE_CHECKS -static bool VerifyMachineDomInfo = true; +bool VerifyMachineDomInfo = true; #else -static bool VerifyMachineDomInfo = false; +bool VerifyMachineDomInfo = false; #endif +} // namespace llvm + static cl::opt<bool, true> VerifyMachineDomInfoX( "verify-machine-dom-info", cl::location(VerifyMachineDomInfo), cl::Hidden, cl::desc("Verify machine dominator info (time consuming)")); @@ -64,21 +67,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 { |