summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 9a9b0c2aeca..b33bc859c5f 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -393,9 +393,16 @@ bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L) {
continue;
// If this is an instruction defined in a nested loop, or outside this loop,
- // don't mess with it.
- if (LI->getLoopFor(User->getParent()) != L)
+ // don't recurse into it.
+ if (LI->getLoopFor(User->getParent()) != L) {
+ DEBUG(std::cerr << "FOUND USER in nested loop: " << *User
+ << " OF SCEV: " << *ISE << "\n");
+
+ // Okay, we found a user that we cannot reduce. Analyze the instruction
+ // and decide what to do with it.
+ IVUsesByStride[Step].addUser(Start, User, I);
continue;
+ }
// Next, see if this user is analyzable itself!
if (!AddUsersIfInteresting(User, L)) {
OpenPOWER on IntegriCloud