mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 16:45:03 +00:00
Fix another lsr-is-nondeterministic case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23695 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a179ab3016
commit
b4dd1b86fa
@ -970,19 +970,23 @@ void LoopStrengthReduce::OptimizeIndvars(Loop *L) {
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user