summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-11-17 02:48:01 +0000
committerDale Johannesen <dalej@apple.com>2007-11-17 02:48:01 +0000
commit7d9766246754a892d818301dbe46ea14976ac746 (patch)
tree34b17e78d683050efff2fcf1ba3fa27a3b235a69 /llvm/lib
parent06a10df562a405c3c3a4499cc999fb1900b54370 (diff)
downloadbcm5719-llvm-7d9766246754a892d818301dbe46ea14976ac746.tar.gz
bcm5719-llvm-7d9766246754a892d818301dbe46ea14976ac746.zip
Remove indeterminism from a loop. We think this will
fix an occasional nonrepeatable bootstrap failure we've been seeing on Darwin. llvm-svn: 44202
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index bd1d66a44de..d1077995831 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -1028,8 +1028,12 @@ unsigned LoopStrengthReduce::CheckForIVReuse(bool HasBaseReg,
const std::vector<BasedUser>& UsersToProcess) {
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Stride)) {
int64_t SInt = SC->getValue()->getSExtValue();
- for (std::map<SCEVHandle, IVsOfOneStride>::iterator SI= IVsByStride.begin(),
- SE = IVsByStride.end(); SI != SE; ++SI) {
+ for (unsigned NewStride = 0, e = StrideOrder.size(); NewStride != e;
+ ++NewStride) {
+ std::map<SCEVHandle, IVsOfOneStride>::iterator SI =
+ IVsByStride.find(StrideOrder[NewStride]);
+ if (SI == IVsByStride.end())
+ continue;
int64_t SSInt = cast<SCEVConstant>(SI->first)->getValue()->getSExtValue();
if (SI->first != Stride &&
(unsigned(abs(SInt)) < SSInt || (SInt % SSInt) != 0))
OpenPOWER on IntegriCloud