aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-13 03:58:31 +0000
committerDan Gohman <gohman@apple.com>2009-02-13 03:58:31 +0000
commit9194e8b0c827c97f396b209c7f4eeb75759e7068 (patch)
treec282871baf2c2da5cb036e3c626880bc461ab040 /lib/Transforms/Scalar/LoopStrengthReduce.cpp
parenta200c8faf852f6caf386c592ec54c723d4b86b96 (diff)
Fix the code that checked if a SCEVAddRecExpr Start contains an
addrec in a different loop to check the value being added to the accumulated Start value, not the Start value before it has the new value added to it. This prevents LSR from going crazy on the included testcase. Dale, please review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 683f741d1e..06d683cab9 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -432,7 +432,7 @@ static bool getSCEVStartAndStride(const SCEVHandle &SH, Loop *L,
// If Start contains an SCEVAddRecExpr from a different loop, other than an
// outer loop of the current loop, reject it. SCEV has no concept of
// operating on one loop at a time so don't confuse it with such expressions.
- if (containsAddRecFromDifferentLoop(Start, L))
+ if (containsAddRecFromDifferentLoop(AddRec->getOperand(0), L))
return false;
Start = SE->getAddExpr(Start, AddRec->getOperand(0));