summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineDominators.cpp
diff options
context:
space:
mode:
authorJakub Kuderski <kubakuderski@gmail.com>2019-10-01 15:23:27 +0000
committerJakub Kuderski <kubakuderski@gmail.com>2019-10-01 15:23:27 +0000
commit56b52a207fef1edb19b0828a21e901627eb9155b (patch)
tree04dbaee3f24bf809a97f8108a297f82f15011739 /llvm/lib/CodeGen/MachineDominators.cpp
parentfd019ed54e36179d0b69d93822164ec2e5689e36 (diff)
downloadbcm5719-llvm-56b52a207fef1edb19b0828a21e901627eb9155b.tar.gz
bcm5719-llvm-56b52a207fef1edb19b0828a21e901627eb9155b.zip
[Dominators][CodeGen] Add MachinePostDominatorTree verification
Summary: This patch implements Machine PostDominator Tree verification and ensures that the verification doesn't fail the in-tree tests. MPDT verification can be enabled using `verify-machine-dom-info` -- the same flag used by Machine Dominator Tree verification. Flipping the flag revealed that MachineSink falsely claimed to preserve CFG and MDT/MPDT. This patch fixes that. Reviewers: arsenm, hliao, rampitec, vpykhtin, grosser Reviewed By: hliao Subscribers: wdng, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68235 llvm-svn: 373341
Diffstat (limited to 'llvm/lib/CodeGen/MachineDominators.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineDominators.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineDominators.cpp b/llvm/lib/CodeGen/MachineDominators.cpp
index 1dfba8638c2..b569ca42d68 100644
--- a/llvm/lib/CodeGen/MachineDominators.cpp
+++ b/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)"));
OpenPOWER on IntegriCloud