summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopInfo.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2019-09-26 15:36:25 +0000
committerWei Mi <wmi@google.com>2019-09-26 15:36:25 +0000
commit67d93f0d915461bfbc5a7cf30e5366d8ddf9b8ac (patch)
treee0203bbf13b60eba01f1db8165c0405a7f9f0644 /llvm/lib/Analysis/LoopInfo.cpp
parentd98cb81cd11c8a4d7017c4820cae202d31d757bb (diff)
downloadbcm5719-llvm-67d93f0d915461bfbc5a7cf30e5366d8ddf9b8ac.tar.gz
bcm5719-llvm-67d93f0d915461bfbc5a7cf30e5366d8ddf9b8ac.zip
[LoopInfo] Limit the iterations to check whether a loop has dedicated exits
for extreme large case. We had a case that a single loop which has 4000 exits and the average number of predecessors of each exit is > 1000, and we found compiling the case spent a significant amount of time on checking whether a loop has dedicated exits. This patch adds a limit for the iterations to the check. With the patch, the time to compile our testcase reduced from 1000s to 200s (clang release build). Differential Revision: https://reviews.llvm.org/D67359 llvm-svn: 372990
Diffstat (limited to 'llvm/lib/Analysis/LoopInfo.cpp')
-rw-r--r--llvm/lib/Analysis/LoopInfo.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 419f013c0e7..5d481a4131a 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -54,6 +54,13 @@ static cl::opt<bool, true>
VerifyLoopInfoX("verify-loop-info", cl::location(VerifyLoopInfo),
cl::Hidden, cl::desc("Verify loop info (time consuming)"));
+namespace llvm {
+cl::opt<uint64_t> MaxDedicateExitIterations(
+ "max-dedicate-exit-iterations", cl::Hidden, cl::init(100000),
+ cl::desc("Max number of loop iterations to check whether a loop is a "
+ "dedicated exit loop. "));
+}
+
//===----------------------------------------------------------------------===//
// Loop implementation
//
OpenPOWER on IntegriCloud