[llvm] r349871 - [LoopUnroll] Don't verify domtree by default with +Asserts.
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 20 17:28:49 PST 2018
Author: efriedma
Date: Thu Dec 20 17:28:49 2018
New Revision: 349871
URL: http://llvm.org/viewvc/llvm-project?rev=349871&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp?rev=349871&r1=349870&r2=349871&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnroll.cpp Thu Dec 20 17:28:49 2018
@@ -54,10 +54,10 @@ UnrollRuntimeEpilog("unroll-runtime-epil
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
);
Modified: llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp?rev=349871&r1=349870&r2=349871&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LoopUnrollPeel.cpp Thu Dec 20 17:28:49 2018
@@ -615,7 +615,9 @@ bool llvm::peelLoop(Loop *L, unsigned Pe
// 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]);
More information about the llvm-commits
mailing list