From 65bddf3b68b5d0fd0a38dcbdffe6d3c5ed1f29c0 Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Fri, 30 Jun 2017 16:33:04 +0000 Subject: [PATCH] [Dominators] Do not perform expensive checks by default. Fix PR33656. Summary: Some transforms assume that DT.verifyDomInfo() is not expensive and call it even when ENABLE_EXPENSIVE_CHECKS is not set. This patch disables expensive Dominator Tree verification (reachability, parent property, sibling property) to fix [[ https://bugs.llvm.org/show_bug.cgi?id=33656 | PR33656 ]]. Note that this is only a temporary fix. Reviewers: dberlin, chapuni, kparzysz, grosser Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34894 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306839 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/IR/Dominators.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/IR/Dominators.cpp b/lib/IR/Dominators.cpp index 6ac3c5e4632..9bd0e297f4e 100644 --- a/lib/IR/Dominators.cpp +++ b/lib/IR/Dominators.cpp @@ -292,7 +292,8 @@ bool DominatorTree::isReachableFromEntry(const Use &U) const { } void DominatorTree::verifyDomTree() const { - if (!verify()) { + // Perform the expensive checks only when VerifyDomInfo is set. + if (VerifyDomInfo && !verify()) { errs() << "\n~~~~~~~~~~~\n\t\tDomTree verification failed!\n~~~~~~~~~~~\n"; print(errs()); abort(); -- 2.50.1