summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-12-10 00:25:00 +0000
committerAndrew Trick <atrick@apple.com>2011-12-10 00:25:00 +0000
commitfa1948a40f14d98c1a31a2ec19035a2d5254e854 (patch)
treeaabe5d0b5556ea47bbe49448950e27a9c67eb1db /lib
parent48171e7fbe58bb418f09717813779d03903d35e4 (diff)
downloadllvm-fa1948a40f14d98c1a31a2ec19035a2d5254e854.tar.gz
llvm-fa1948a40f14d98c1a31a2ec19035a2d5254e854.tar.bz2
llvm-fa1948a40f14d98c1a31a2ec19035a2d5254e854.tar.xz
LSR: ignore strides in outer loops.
Since we're not rewriting IVs in other loops, there's not much reason to consider their stride when generating formulae. This should reduce the number of useless formulas considered by LSR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146302 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 7867d9fad3..ad2f52d8ec 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -2061,7 +2061,8 @@ void LSRInstance::CollectInterestingTypesAndFactors() {
do {
const SCEV *S = Worklist.pop_back_val();
if (const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(S)) {
- Strides.insert(AR->getStepRecurrence(SE));
+ if (EnableNested || AR->getLoop() == L)
+ Strides.insert(AR->getStepRecurrence(SE));
Worklist.push_back(AR->getStart());
} else if (const SCEVAddExpr *Add = dyn_cast<SCEVAddExpr>(S)) {
Worklist.append(Add->op_begin(), Add->op_end());