[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Oct 11 11:18:09 PDT 2005
Changes in directory llvm/lib/Transforms/Scalar:
LoopStrengthReduce.cpp updated: 1.65 -> 1.66
---
Log message:
Fix another lsr-is-nondeterministic case
---
Diffs of the changes: (+10 -6)
LoopStrengthReduce.cpp | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.65 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.66
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.65 Sun Oct 9 01:24:02 2005
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Oct 11 13:17:57 2005
@@ -970,19 +970,23 @@
IVStrideUse *CondUse = 0;
const SCEVHandle *CondStride = 0;
- for (std::map<SCEVHandle, IVUsersOfOneStride>::iterator
- I = IVUsesByStride.begin(), E = IVUsesByStride.end();
- I != E && !CondUse; ++I)
- for (std::vector<IVStrideUse>::iterator UI = I->second.Users.begin(),
- E = I->second.Users.end(); UI != E; ++UI)
+ for (unsigned Stride = 0, e = StrideOrder.size(); Stride != e && !CondUse;
+ ++Stride) {
+ std::map<SCEVHandle, IVUsersOfOneStride>::iterator SI =
+ IVUsesByStride.find(StrideOrder[Stride]);
+ assert(SI != IVUsesByStride.end() && "Stride doesn't exist!");
+
+ for (std::vector<IVStrideUse>::iterator UI = SI->second.Users.begin(),
+ E = SI->second.Users.end(); UI != E; ++UI)
if (UI->User == Cond) {
CondUse = &*UI;
- CondStride = &I->first;
+ CondStride = &SI->first;
// NOTE: we could handle setcc instructions with multiple uses here, but
// InstCombine does it as well for simple uses, it's not clear that it
// occurs enough in real life to handle.
break;
}
+ }
if (!CondUse) return; // setcc doesn't use the IV.
// setcc stride is complex, don't mess with users.
More information about the llvm-commits
mailing list