mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
Fix
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070423/048333.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36380 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9690809ddd
commit
2a5fa18997
@ -416,12 +416,16 @@ bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L,
|
||||
if (!getSCEVStartAndStride(ISE, L, Start, Stride))
|
||||
return false; // Non-reducible symbolic expression, bail out.
|
||||
|
||||
for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E;) {
|
||||
Instruction *User = cast<Instruction>(*UI);
|
||||
std::vector<Instruction *> IUsers;
|
||||
// Collect all I uses now because IVUseShouldUsePostIncValue may
|
||||
// invalidate use_iterator.
|
||||
for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); UI != E; ++UI)
|
||||
IUsers.push_back(cast<Instruction>(*UI));
|
||||
|
||||
// Increment iterator now because IVUseShouldUsePostIncValue may remove
|
||||
// User from the list of I users.
|
||||
++UI;
|
||||
for (unsigned iused_index = 0, iused_size = IUsers.size();
|
||||
iused_index != iused_size; ++iused_index) {
|
||||
|
||||
Instruction *User = IUsers[iused_index];
|
||||
|
||||
// Do not infinitely recurse on PHI nodes.
|
||||
if (isa<PHINode>(User) && Processed.count(User))
|
||||
|
Loading…
Reference in New Issue
Block a user