[PATCH] D41703: [X86] Remove side-effects from determineCalleeSaves
Francis Visoiu Mistrih via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 8 02:47:18 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL321987: [X86] Remove side-effects from determineCalleeSaves (authored by thegameg, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D41703?vs=128528&id=128901#toc
Repository:
rL LLVM
https://reviews.llvm.org/D41703
Files:
llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
Index: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
@@ -1855,6 +1855,32 @@
unsigned CalleeSavedFrameSize = 0;
int SpillSlotOffset = getOffsetOfLocalArea() + X86FI->getTCReturnAddrDelta();
+ int64_t TailCallReturnAddrDelta = X86FI->getTCReturnAddrDelta();
+
+ if (TailCallReturnAddrDelta < 0) {
+ // create RETURNADDR area
+ // arg
+ // arg
+ // RETADDR
+ // { ...
+ // RETADDR area
+ // ...
+ // }
+ // [EBP]
+ MFI.CreateFixedObject(-TailCallReturnAddrDelta,
+ TailCallReturnAddrDelta - SlotSize, true);
+ }
+
+ // Spill the BasePtr if it's used.
+ if (this->TRI->hasBasePointer(MF)) {
+ // Allocate a spill slot for EBP if we have a base pointer and EH funclets.
+ if (MF.hasEHFunclets()) {
+ int FI = MFI.CreateSpillStackObject(SlotSize, SlotSize);
+ X86FI->setHasSEHFramePtrSave(true);
+ X86FI->setSEHFramePtrSaveIndex(FI);
+ }
+ }
+
if (hasFP(MF)) {
// emitPrologue always spills frame register the first thing.
SpillSlotOffset -= SlotSize;
@@ -2060,36 +2086,9 @@
RegScavenger *RS) const {
TargetFrameLowering::determineCalleeSaves(MF, SavedRegs, RS);
- MachineFrameInfo &MFI = MF.getFrameInfo();
-
- X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
- int64_t TailCallReturnAddrDelta = X86FI->getTCReturnAddrDelta();
-
- if (TailCallReturnAddrDelta < 0) {
- // create RETURNADDR area
- // arg
- // arg
- // RETADDR
- // { ...
- // RETADDR area
- // ...
- // }
- // [EBP]
- MFI.CreateFixedObject(-TailCallReturnAddrDelta,
- TailCallReturnAddrDelta - SlotSize, true);
- }
-
// Spill the BasePtr if it's used.
- if (TRI->hasBasePointer(MF)) {
+ if (TRI->hasBasePointer(MF))
SavedRegs.set(TRI->getBaseRegister());
-
- // Allocate a spill slot for EBP if we have a base pointer and EH funclets.
- if (MF.hasEHFunclets()) {
- int FI = MFI.CreateSpillStackObject(SlotSize, SlotSize);
- X86FI->setHasSEHFramePtrSave(true);
- X86FI->setSEHFramePtrSaveIndex(FI);
- }
- }
}
static bool
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41703.128901.patch
Type: text/x-patch
Size: 2369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180108/a83a9d43/attachment.bin>
More information about the llvm-commits
mailing list