1 //===- XtensaFrameLowering.h - Define frame lowering for Xtensa --*- C++ -*-==//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===-----------------------------------------------------------------------==//
9 #ifndef LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H
10 #define LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H
12 #include "llvm/CodeGen/TargetFrameLowering.h"
15 class XtensaTargetMachine
;
16 class XtensaSubtarget
;
17 class XtensaInstrInfo
;
18 class XtensaRegisterInfo
;
20 class XtensaFrameLowering
: public TargetFrameLowering
{
21 const XtensaInstrInfo
&TII
;
22 const XtensaRegisterInfo
*TRI
;
25 XtensaFrameLowering(const XtensaSubtarget
&STI
);
27 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
29 void emitPrologue(MachineFunction
&, MachineBasicBlock
&) const override
;
30 void emitEpilogue(MachineFunction
&MF
, MachineBasicBlock
&MBB
) const override
;
32 MachineBasicBlock::iterator
33 eliminateCallFramePseudoInstr(MachineFunction
&MF
, MachineBasicBlock
&MBB
,
34 MachineBasicBlock::iterator I
) const override
;
36 bool spillCalleeSavedRegisters(MachineBasicBlock
&MBB
,
37 MachineBasicBlock::iterator MI
,
38 ArrayRef
<CalleeSavedInfo
> CSI
,
39 const TargetRegisterInfo
*TRI
) const override
;
41 restoreCalleeSavedRegisters(MachineBasicBlock
&MBB
,
42 MachineBasicBlock::iterator MI
,
43 MutableArrayRef
<CalleeSavedInfo
> CSI
,
44 const TargetRegisterInfo
*TRI
) const override
;
46 void determineCalleeSaves(MachineFunction
&MF
, BitVector
&SavedRegs
,
47 RegScavenger
*RS
) const override
;
49 void processFunctionBeforeFrameFinalized(MachineFunction
&MF
,
50 RegScavenger
*RS
) const override
;
53 bool hasFPImpl(const MachineFunction
&MF
) const override
;
58 #endif /* LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H */