]> granicus.if.org Git - llvm/commitdiff
[Dominators] Do not perform expensive checks by default. Fix PR33656.
authorJakub Kuderski <kubakuderski@gmail.com>
Fri, 30 Jun 2017 16:33:04 +0000 (16:33 +0000)
committerJakub Kuderski <kubakuderski@gmail.com>
Fri, 30 Jun 2017 16:33:04 +0000 (16:33 +0000)
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

index 6ac3c5e4632cb7365e128fac736f10bdb81ebc34..9bd0e297f4ef829e5306e8f6f151cfb7a95b4183 100644 (file)
@@ -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();