summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2018-12-21 01:28:49 +0000
committerEli Friedman <efriedma@codeaurora.org>2018-12-21 01:28:49 +0000
commit3af2f534565caa91eaadb6e504847000db2673de (patch)
treea7a9ef49649fa503474189d9036fc27d35972ede /llvm/lib/Transforms
parent7b7813740382d6dc3eddc51f51d0428537f33b15 (diff)
downloadbcm5719-llvm-3af2f534565caa91eaadb6e504847000db2673de.tar.gz
bcm5719-llvm-3af2f534565caa91eaadb6e504847000db2673de.zip
[LoopUnroll] Don't verify domtree by default with +Asserts.
This verification is linear in the size of the function, so it can cause a quadratic compile-time explosion in a function with many loops to unroll. Differential Revision: https://reviews.llvm.org/D54732 llvm-svn: 349871
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnroll.cpp6
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index efd8b92e814..0ed4038cc3e 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -54,10 +54,10 @@ UnrollRuntimeEpilog("unroll-runtime-epilog", cl::init(false), cl::Hidden,
static cl::opt<bool>
UnrollVerifyDomtree("unroll-verify-domtree", cl::Hidden,
cl::desc("Verify domtree after unrolling"),
-#ifdef NDEBUG
- cl::init(false)
-#else
+#ifdef EXPENSIVE_CHECKS
cl::init(true)
+#else
+ cl::init(false)
#endif
);
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp
index 86ac1a71d5e..151a285af4e 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp
@@ -615,7 +615,9 @@ bool llvm::peelLoop(Loop *L, unsigned PeelCount, LoopInfo *LI,
// the original loop body.
if (Iter == 0)
DT->changeImmediateDominator(Exit, cast<BasicBlock>(LVMap[Latch]));
+#ifdef EXPENSIVE_CHECKS
assert(DT->verify(DominatorTree::VerificationLevel::Fast));
+#endif
}
auto *LatchBRCopy = cast<BranchInst>(VMap[LatchBR]);
OpenPOWER on IntegriCloud