mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-11 10:31:27 +00:00
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
This commit is contained in:
parent
d0763b9159
commit
b51b4b5fdf
@ -1028,8 +1028,12 @@ unsigned LoopStrengthReduce::CheckForIVReuse(bool HasBaseReg,
|
|||||||
const std::vector<BasedUser>& UsersToProcess) {
|
const std::vector<BasedUser>& UsersToProcess) {
|
||||||
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Stride)) {
|
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Stride)) {
|
||||||
int64_t SInt = SC->getValue()->getSExtValue();
|
int64_t SInt = SC->getValue()->getSExtValue();
|
||||||
for (std::map<SCEVHandle, IVsOfOneStride>::iterator SI= IVsByStride.begin(),
|
for (unsigned NewStride = 0, e = StrideOrder.size(); NewStride != e;
|
||||||
SE = IVsByStride.end(); SI != SE; ++SI) {
|
++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();
|
int64_t SSInt = cast<SCEVConstant>(SI->first)->getValue()->getSExtValue();
|
||||||
if (SI->first != Stride &&
|
if (SI->first != Stride &&
|
||||||
(unsigned(abs(SInt)) < SSInt || (SInt % SSInt) != 0))
|
(unsigned(abs(SInt)) < SSInt || (SInt % SSInt) != 0))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user