diff options
author | Amir Aupov <amir.aupov@gmail.com> | 2023-02-09 10:52:51 -0800 |
---|---|---|
committer | Amir Ayupov <aaupov@fb.com> | 2023-02-09 10:53:11 -0800 |
commit | 782045e727b70d19c7fa70c388eddb65390060d9 (patch) | |
tree | b40db883bb4004e0d0f43ab39ae26c29d27f9488 /llvm/lib/CodeGen/PrologEpilogInserter.cpp | |
parent | bd11b2bdf37490c2a3a3998be8d2f9499996b396 (diff) | |
download | llvm-782045e727b70d19c7fa70c388eddb65390060d9.zip llvm-782045e727b70d19c7fa70c388eddb65390060d9.tar.gz llvm-782045e727b70d19c7fa70c388eddb65390060d9.tar.bz2 |
Revert "HHVM calling conventions."
This reverts commit cce239c45d6ef3865a017b5b3f935964e0348734.
HHVM calling conventions are unused. Remove them by partially reverting the commit.
Reviewed By: MaskRay, MatzeB
Differential Revision: https://reviews.llvm.org/D124330
Diffstat (limited to 'llvm/lib/CodeGen/PrologEpilogInserter.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PrologEpilogInserter.cpp | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index cc70ec4..752cff1 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -692,7 +692,7 @@ void PEI::spillCalleeSavedRegs(MachineFunction &MF) { /// AdjustStackOffset - Helper function used to adjust the stack frame offset. static inline void AdjustStackOffset(MachineFrameInfo &MFI, int FrameIdx, bool StackGrowsDown, int64_t &Offset, - Align &MaxAlign, unsigned Skew) { + Align &MaxAlign) { // If the stack grows down, add the object size to find the lowest address. if (StackGrowsDown) Offset += MFI.getObjectSize(FrameIdx); @@ -704,7 +704,7 @@ static inline void AdjustStackOffset(MachineFrameInfo &MFI, int FrameIdx, MaxAlign = std::max(MaxAlign, Alignment); // Adjust to alignment boundary. - Offset = alignTo(Offset, Alignment, Skew); + Offset = alignTo(Offset, Alignment); if (StackGrowsDown) { LLVM_DEBUG(dbgs() << "alloc FI(" << FrameIdx << ") at SP[" << -Offset @@ -828,11 +828,10 @@ static inline bool scavengeStackSlot(MachineFrameInfo &MFI, int FrameIdx, static void AssignProtectedObjSet(const StackObjSet &UnassignedObjs, SmallSet<int, 16> &ProtectedObjs, MachineFrameInfo &MFI, bool StackGrowsDown, - int64_t &Offset, Align &MaxAlign, - unsigned Skew) { + int64_t &Offset, Align &MaxAlign) { for (int i : UnassignedObjs) { - AdjustStackOffset(MFI, i, StackGrowsDown, Offset, MaxAlign, Skew); + AdjustStackOffset(MFI, i, StackGrowsDown, Offset, MaxAlign); ProtectedObjs.insert(i); } } @@ -858,9 +857,6 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { && "Local area offset should be in direction of stack growth"); int64_t Offset = LocalAreaOffset; - // Skew to be applied to alignment. - unsigned Skew = TFI.getStackAlignmentSkew(MF); - #ifdef EXPENSIVE_CHECKS for (unsigned i = 0, e = MFI.getObjectIndexEnd(); i != e; ++i) if (!MFI.isDeadObjectIndex(i) && @@ -908,8 +904,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { if (!StackGrowsDown && MFI.isDeadObjectIndex(FrameIndex)) continue; - AdjustStackOffset(MFI, FrameIndex, StackGrowsDown, Offset, MaxAlign, - Skew); + AdjustStackOffset(MFI, FrameIndex, StackGrowsDown, Offset, MaxAlign); } } @@ -930,7 +925,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { SmallVector<int, 2> SFIs; RS->getScavengingFrameIndices(SFIs); for (int SFI : SFIs) - AdjustStackOffset(MFI, SFI, StackGrowsDown, Offset, MaxAlign, Skew); + AdjustStackOffset(MFI, SFI, StackGrowsDown, Offset, MaxAlign); } // FIXME: Once this is working, then enable flag will change to a target @@ -941,7 +936,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { Align Alignment = MFI.getLocalFrameMaxAlign(); // Adjust to alignment boundary. - Offset = alignTo(Offset, Alignment, Skew); + Offset = alignTo(Offset, Alignment); LLVM_DEBUG(dbgs() << "Local frame base offset: " << Offset << "\n"); @@ -987,8 +982,8 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { "Stack protector on non-default stack expected to not be " "pre-allocated by LocalStackSlotPass."); } else if (!MFI.getUseLocalStackAllocationBlock()) { - AdjustStackOffset(MFI, StackProtectorFI, StackGrowsDown, Offset, MaxAlign, - Skew); + AdjustStackOffset(MFI, StackProtectorFI, StackGrowsDown, Offset, + MaxAlign); } else if (!MFI.isObjectPreAllocated(MFI.getStackProtectorIndex())) { llvm_unreachable( "Stack protector not pre-allocated by LocalStackSlotPass."); @@ -1036,11 +1031,11 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { "LocalStackSlotPass."); AssignProtectedObjSet(LargeArrayObjs, ProtectedObjs, MFI, StackGrowsDown, - Offset, MaxAlign, Skew); + Offset, MaxAlign); AssignProtectedObjSet(SmallArrayObjs, ProtectedObjs, MFI, StackGrowsDown, - Offset, MaxAlign, Skew); + Offset, MaxAlign); AssignProtectedObjSet(AddrOfObjs, ProtectedObjs, MFI, StackGrowsDown, - Offset, MaxAlign, Skew); + Offset, MaxAlign); } SmallVector<int, 8> ObjectsToAllocate; @@ -1071,7 +1066,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { // Allocate the EH registration node first if one is present. if (EHRegNodeFrameIndex != std::numeric_limits<int>::max()) AdjustStackOffset(MFI, EHRegNodeFrameIndex, StackGrowsDown, Offset, - MaxAlign, Skew); + MaxAlign); // Give the targets a chance to order the objects the way they like it. if (MF.getTarget().getOptLevel() != CodeGenOpt::None && @@ -1093,7 +1088,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { for (auto &Object : ObjectsToAllocate) if (!scavengeStackSlot(MFI, Object, StackGrowsDown, MaxAlign, StackBytesFree)) - AdjustStackOffset(MFI, Object, StackGrowsDown, Offset, MaxAlign, Skew); + AdjustStackOffset(MFI, Object, StackGrowsDown, Offset, MaxAlign); // Make sure the special register scavenging spill slot is closest to the // stack pointer. @@ -1101,7 +1096,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { SmallVector<int, 2> SFIs; RS->getScavengingFrameIndices(SFIs); for (int SFI : SFIs) - AdjustStackOffset(MFI, SFI, StackGrowsDown, Offset, MaxAlign, Skew); + AdjustStackOffset(MFI, SFI, StackGrowsDown, Offset, MaxAlign); } if (!TFI.targetHandlesStackFrameRounding()) { @@ -1127,7 +1122,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &MF) { // SP not FP. Align to MaxAlign so this works. StackAlign = std::max(StackAlign, MaxAlign); int64_t OffsetBeforeAlignment = Offset; - Offset = alignTo(Offset, StackAlign, Skew); + Offset = alignTo(Offset, StackAlign); // If we have increased the offset to fulfill the alignment constrants, // then the scavenging spill slots may become harder to reach from the |