LLVM 24.0.0git
XtensaFrameLowering.h
Go to the documentation of this file.
1//===- XtensaFrameLowering.h - Define frame lowering for Xtensa --*- C++ -*-==//
2//
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
6//
7//===-----------------------------------------------------------------------==//
8
9#ifndef LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H
10#define LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H
11
13
14namespace llvm {
15class XtensaSubtarget;
16class XtensaInstrInfo;
18
20 const XtensaSubtarget &STI;
21 const XtensaInstrInfo &TII;
22 const XtensaRegisterInfo *TRI;
23
24public:
26
27 /// emitProlog/emitEpilog - These methods insert prolog and epilog code into
28 /// the function.
29 void emitPrologue(MachineFunction &, MachineBasicBlock &) const override;
30 void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
31
34 MachineBasicBlock::iterator I) const override;
35
39 const TargetRegisterInfo *TRI) const override;
40 bool
44 const TargetRegisterInfo *TRI) const override;
45
47 RegScavenger *RS) const override;
48
50 RegScavenger *RS) const override;
51
52 // The default assumes that the frame pointer is at the opposite end of the
53 // frame from SP, and allocates the slot near the incoming SP. Here the frame
54 // pointer equals SP after the prologue, so that slot could be out of reach.
56 const MachineFunction &MF) const override {
57 return false;
58 }
59
60protected:
61 bool hasFPImpl(const MachineFunction &MF) const override;
62};
63
64} // namespace llvm
65
66#endif /* LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H */
MachineBasicBlock & MBB
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:57
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
MachineInstrBundleIterator< MachineInstr > iterator
Represent a mutable reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:294
TargetFrameLowering(StackDirection D, Align StackAl, int LAO, Align TransAl=Align(1), bool StackReal=true)
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS) const override
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function...
bool hasFPImpl(const MachineFunction &MF) const override
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, MutableArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
void emitPrologue(MachineFunction &, MachineBasicBlock &) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
XtensaFrameLowering(const XtensaSubtarget &STI)
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, ArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns tru...
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
bool allocateScavengingFrameIndexesNearIncomingSP(const MachineFunction &MF) const override
Control the placement of special register scavenging spill slots when allocating a stack frame.
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
This is an optimization pass for GlobalISel generic memory operations.