[llvm] cd7f805 - [InstCombine] Lower infinite combine loop detection thresholds
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 6 03:20:05 PDT 2020
Author: Roman Lebedev
Date: 2020-07-06T13:19:31+03:00
New Revision: cd7f8051ac7b6f08734102446482c1e5d951bfcc
URL: https://github.com/llvm/llvm-project/commit/cd7f8051ac7b6f08734102446482c1e5d951bfcc
DIFF: https://github.com/llvm/llvm-project/commit/cd7f8051ac7b6f08734102446482c1e5d951bfcc.diff
LOG: [InstCombine] Lower infinite combine loop detection thresholds
Summary:
1000 iteratons is still kinda a lot.
Would it make sense to iteratively lower it, until it becomes `2`,
with some delay inbetween in order to let users actually potentially encounter it?
Reviewers: spatel, nikic, kuhar
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D83160
Added:
Modified:
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
index d1c1e5418825..e810b3de25bc 100644
--- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
@@ -123,8 +123,13 @@ STATISTIC(NumReassoc , "Number of reassociations");
DEBUG_COUNTER(VisitCounter, "instcombine-visit",
"Controls which instructions are visited");
+// FIXME: these limits eventually should be as low as 2.
static constexpr unsigned InstCombineDefaultMaxIterations = 1000;
+#ifndef NDEBUG
+static constexpr unsigned InstCombineDefaultInfiniteLoopThreshold = 100;
+#else
static constexpr unsigned InstCombineDefaultInfiniteLoopThreshold = 1000;
+#endif
static cl::opt<bool>
EnableCodeSinking("instcombine-code-sinking", cl::desc("Enable code sinking"),
More information about the llvm-commits
mailing list