mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Don't skip over all "terminator" instructions when determining where to put the
callee-saved restore code. It could skip over conditional jumps accidentally. Instead, just skip the "return" instructions. llvm-svn: 58489
This commit is contained in:
parent
8abdac1eb4
commit
0f1f4f8bb1
@ -273,10 +273,10 @@ void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) {
|
|||||||
MBB = FI;
|
MBB = FI;
|
||||||
I = MBB->end(); --I;
|
I = MBB->end(); --I;
|
||||||
|
|
||||||
// Skip over all terminator instructions, which are part of the return
|
// Skip over all "return" instructions, which are part of the return
|
||||||
// sequence.
|
// sequence.
|
||||||
MachineBasicBlock::iterator I2 = I;
|
MachineBasicBlock::iterator I2 = I;
|
||||||
while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator())
|
while (I2 != MBB->begin() && (--I2)->getDesc().isReturn())
|
||||||
I = I2;
|
I = I2;
|
||||||
|
|
||||||
bool AtStart = I == MBB->begin();
|
bool AtStart = I == MBB->begin();
|
||||||
|
@ -850,8 +850,7 @@ void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
|
|||||||
while (MBBI != MBB.begin()) {
|
while (MBBI != MBB.begin()) {
|
||||||
MachineBasicBlock::iterator PI = prior(MBBI);
|
MachineBasicBlock::iterator PI = prior(MBBI);
|
||||||
unsigned Opc = PI->getOpcode();
|
unsigned Opc = PI->getOpcode();
|
||||||
if (Opc != X86::POP32r && Opc != X86::POP64r &&
|
if (Opc != X86::POP32r && Opc != X86::POP64r && !PI->getDesc().isReturn())
|
||||||
!PI->getDesc().isTerminator())
|
|
||||||
break;
|
break;
|
||||||
--MBBI;
|
--MBBI;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user