Skip to content

[SystemZ][z/OS] Update lowerCall #68259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,18 @@ void SystemZXPLINKFrameLowering::processFunctionBeforeFrameFinalized(

// Setup stack frame offset
MFFrame.setOffsetAdjustment(Regs.getStackPointerBias());

// Nothing to do for leaf functions.
uint64_t StackSize = MFFrame.estimateStackSize(MF);
if (StackSize == 0 && MFFrame.getCalleeSavedInfo().empty())
return;

// Although the XPLINK specifications for AMODE64 state that minimum size
// of the param area is minimum 32 bytes and no rounding is otherwise
// specified, we round this area in 64 bytes increments to be compatible
// with existing compilers.
MFFrame.setMaxCallFrameSize(
std::max(64U, (unsigned)alignTo(MFFrame.getMaxCallFrameSize(), 64)));
}

// Determines the size of the frame, and creates the deferred spill objects.
Expand Down
7 changes: 0 additions & 7 deletions llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1816,13 +1816,6 @@ SystemZTargetLowering::LowerCall(CallLoweringInfo &CLI,
// Get a count of how many bytes are to be pushed on the stack.
unsigned NumBytes = ArgCCInfo.getStackSize();

if (Subtarget.isTargetXPLINK64())
// Although the XPLINK specifications for AMODE64 state that minimum size
// of the param area is minimum 32 bytes and no rounding is otherwise
// specified, we round this area in 64 bytes increments to be compatible
// with existing compilers.
NumBytes = std::max(64U, (unsigned)alignTo(NumBytes, 64));

// Mark the start of the call.
if (!IsTailCall)
Chain = DAG.getCALLSEQ_START(Chain, NumBytes, 0, DL);
Expand Down