Skip to content

Commit

Permalink
[Xtensa] Add spill slot for smaller estimaded stack size.
Browse files Browse the repository at this point in the history
  • Loading branch information
sstefan1 authored and gerekon committed Dec 27, 2023
1 parent a31365f commit 7ea9cd0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llvm/lib/Target/Xtensa/XtensaFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/IR/Function.h"

#define STACK_SIZE_THRESHOLD 100

using namespace llvm;

XtensaFrameLowering::XtensaFrameLowering()
Expand Down Expand Up @@ -375,7 +377,8 @@ void XtensaFrameLowering::processFunctionBeforeFrameFinalized(

// In WinABI mode add register scavenging slot
// FIXME: It may be posssible to add spill slot by more optimal way
if (STI.isWinABI() && (MF.getFrameInfo().estimateStackSize(MF) > 256)) {
if (STI.isWinABI() &&
(MF.getFrameInfo().estimateStackSize(MF) > STACK_SIZE_THRESHOLD)) {
MachineFrameInfo &MFI = MF.getFrameInfo();
const TargetRegisterClass &RC = Xtensa::ARRegClass;
const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo();
Expand Down

0 comments on commit 7ea9cd0

Please sign in to comment.