forked from OSchip/llvm-project
X86RegisterInfo: eliminateFrameIndex: Force SP for AfterFPPop; NFC
AfterFPPop is used for tailcall/tailjump instructions. We shouldn't ever have frame-pointer/base-pointer relative addressing for those. After all the frame/base pointer should already be restored to their previous values at the return. Make this fact explicit in preparation for an upcoming refactoring. Differential Revision: https://reviews.llvm.org/D32205 llvm-svn: 300922
This commit is contained in:
parent
8048b44a8c
commit
63e3e8ce72
|
@ -675,12 +675,13 @@ X86RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
|||
bool AfterFPPop = Opc == X86::TAILJMPm64 || Opc == X86::TAILJMPm ||
|
||||
Opc == X86::TCRETURNmi || Opc == X86::TCRETURNmi64;
|
||||
|
||||
if (hasBasePointer(MF))
|
||||
if (AfterFPPop) {
|
||||
assert(FrameIndex < 0 && "Should only reference fixed stack objects here");
|
||||
BasePtr = StackPtr;
|
||||
} else if (hasBasePointer(MF))
|
||||
BasePtr = (FrameIndex < 0 ? FramePtr : getBaseRegister());
|
||||
else if (needsStackRealignment(MF))
|
||||
BasePtr = (FrameIndex < 0 ? FramePtr : StackPtr);
|
||||
else if (AfterFPPop)
|
||||
BasePtr = StackPtr;
|
||||
else
|
||||
BasePtr = (TFI->hasFP(MF) ? FramePtr : StackPtr);
|
||||
|
||||
|
|
Loading…
Reference in New Issue