aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-10-16 05:26:21 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-10-16 05:26:21 +0000
commitfdfd98ceecd17bf5d72bf4ed1a86948ad590c647 (patch)
tree8e88096b377fd5a68e74f79da76d440d16e76f6f /llvm/lib/Analysis/ScalarEvolution.cpp
parent28d467a809de1ac1e720d52c9296176cbe822a86 (diff)
downloadllvm-fdfd98ceecd17bf5d72bf4ed1a86948ad590c647.zip
llvm-fdfd98ceecd17bf5d72bf4ed1a86948ad590c647.tar.gz
llvm-fdfd98ceecd17bf5d72bf4ed1a86948ad590c647.tar.bz2
[SCEV] Limit AddRec "simplifications" to avoid combinatorial explosions
SCEV's transform that turns `{A1,+,A2,+,...,+,An}<L> * {B1,+,B2,+,...,+,Bn}<L>` into a single AddRec of size `2n+1` with complex combinatorial coefficients can easily trigger exponential growth of the SCEV (in case if nothing gets folded and simplified). We tried to restrain this transform using the option `scalar-evolution-max-add-rec-size`, but its default value seems to be insufficiently small: the test attached to this patch with default value of this option `16` has a SCEV of >3M symbols (when printed out). This patch reduces the simplification limit. It is not a cure to combinatorial explosions, but at least it reduces this corner case to something more or less reasonable. Differential Revision: https://reviews.llvm.org/D53282 Reviewed By: sanjoy llvm-svn: 344584
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 4a30447..60cd1cb 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -204,7 +204,7 @@ static cl::opt<unsigned>
static cl::opt<unsigned>
MaxAddRecSize("scalar-evolution-max-add-rec-size", cl::Hidden,
cl::desc("Max coefficients in AddRec during evolving"),
- cl::init(16));
+ cl::init(8));
//===----------------------------------------------------------------------===//
// SCEV class definitions