diff options
author | Dale Johannesen <dalej@apple.com> | 2007-11-17 02:48:01 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-11-17 02:48:01 +0000 |
commit | b51b4b5fdfdd7a85ea66776d7900214f8b24f826 (patch) | |
tree | ff0627bf9bf1233b856ca1f16d7ff8dd871c162c /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | d0763b91594982752db9f3eabbb2ea40867ca88a (diff) |
Remove indeterminism from a loop. We think this will
fix an occasional nonrepeatable bootstrap failure we've
been seeing on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44202 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index bd1d66a44d..d107799583 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/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)) |