diff options
| author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2017-03-05 23:49:17 +0000 |
|---|---|---|
| committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2017-03-05 23:49:17 +0000 |
| commit | 1bd479dd5cf239a17ce7423b9ce8667ceb0abe92 (patch) | |
| tree | 2677fac230406087f33928740a10536babfc9320 /llvm/lib/Analysis/ScalarEvolution.cpp | |
| parent | fa1ef7d89cb4034536fecee06c64bb68cbfbc623 (diff) | |
| download | bcm5719-llvm-1bd479dd5cf239a17ce7423b9ce8667ceb0abe92.tar.gz bcm5719-llvm-1bd479dd5cf239a17ce7423b9ce8667ceb0abe92.zip | |
[SCEV] Decrease the recursion threshold for CompareValueComplexity
Fixes PR32142.
r287232 accidentally increased the recursion threshold for
CompareValueComplexity from 2 to 32. This change reverses that change
by introducing a separate flag for CompareValueComplexity's threshold.
llvm-svn: 296992
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 5d5b9b39959..d96a77e0abf 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -132,10 +132,15 @@ static cl::opt<unsigned> AddOpsInlineThreshold( cl::desc("Threshold for inlining multiplication operands into a SCEV"), cl::init(500)); -static cl::opt<unsigned> - MaxCompareDepth("scalar-evolution-max-compare-depth", cl::Hidden, - cl::desc("Maximum depth of recursive compare complexity"), - cl::init(32)); +static cl::opt<unsigned> MaxSCEVCompareDepth( + "scalar-evolution-max-scev-compare-depth", cl::Hidden, + cl::desc("Maximum depth of recursive SCEV complexity comparisons"), + cl::init(32)); + +static cl::opt<unsigned> MaxValueCompareDepth( + "scalar-evolution-max-value-compare-depth", cl::Hidden, + cl::desc("Maximum depth of recursive value complexity comparisons"), + cl::init(2)); static cl::opt<unsigned> MaxAddExprDepth("scalar-evolution-max-addexpr-depth", cl::Hidden, @@ -496,7 +501,7 @@ static int CompareValueComplexity(SmallSet<std::pair<Value *, Value *>, 8> &EqCache, const LoopInfo *const LI, Value *LV, Value *RV, unsigned Depth) { - if (Depth > MaxCompareDepth || EqCache.count({LV, RV})) + if (Depth > MaxValueCompareDepth || EqCache.count({LV, RV})) return 0; // Order pointer values after integer values. This helps SCEVExpander form @@ -583,7 +588,7 @@ static int CompareSCEVComplexity( if (LType != RType) return (int)LType - (int)RType; - if (Depth > MaxCompareDepth || EqCacheSCEV.count({LHS, RHS})) + if (Depth > MaxSCEVCompareDepth || EqCacheSCEV.count({LHS, RHS})) return 0; // Aside from the getSCEVType() ordering, the particular ordering // isn't very important except that it's beneficial to be consistent, |

