mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
Fix PEI to not walk off the start of a block when an updated instruction
is the first in its block. This is PR3842. llvm-svn: 67304
This commit is contained in:
parent
45d4adde66
commit
3181caa065
@ -533,11 +533,15 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) {
|
||||
|
||||
SPAdj += Size;
|
||||
|
||||
MachineBasicBlock::iterator PrevI = prior(I);
|
||||
MachineBasicBlock::iterator PrevI = BB->end();
|
||||
if (I != BB->begin()) PrevI = prior(I);
|
||||
TRI.eliminateCallFramePseudoInstr(Fn, *BB, I);
|
||||
|
||||
// Visit the instructions created by eliminateCallFramePseudoInstr().
|
||||
I = next(PrevI);
|
||||
if (PrevI == BB->end())
|
||||
I = BB->begin(); // The replaced instr was the first in the block.
|
||||
else
|
||||
I = next(PrevI);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user