
Implement base windowed register call ABI. By defaullt use rotation window by 8 registers.
60 lines
2.2 KiB
C++
60 lines
2.2 KiB
C++
//===- XtensaFrameLowering.h - Define frame lowering for Xtensa --*- C++ -*-==//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===-----------------------------------------------------------------------==//
|
|
|
|
#ifndef LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H
|
|
#define LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H
|
|
|
|
#include "llvm/CodeGen/TargetFrameLowering.h"
|
|
|
|
namespace llvm {
|
|
class XtensaTargetMachine;
|
|
class XtensaSubtarget;
|
|
class XtensaInstrInfo;
|
|
class XtensaRegisterInfo;
|
|
|
|
class XtensaFrameLowering : public TargetFrameLowering {
|
|
const XtensaSubtarget &STI;
|
|
const XtensaInstrInfo &TII;
|
|
const XtensaRegisterInfo *TRI;
|
|
|
|
public:
|
|
XtensaFrameLowering(const XtensaSubtarget &STI);
|
|
|
|
/// emitProlog/emitEpilog - These methods insert prolog and epilog code into
|
|
/// the function.
|
|
void emitPrologue(MachineFunction &, MachineBasicBlock &) const override;
|
|
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
|
|
|
|
MachineBasicBlock::iterator
|
|
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
|
MachineBasicBlock::iterator I) const override;
|
|
|
|
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|
MachineBasicBlock::iterator MI,
|
|
ArrayRef<CalleeSavedInfo> CSI,
|
|
const TargetRegisterInfo *TRI) const override;
|
|
bool
|
|
restoreCalleeSavedRegisters(MachineBasicBlock &MBB,
|
|
MachineBasicBlock::iterator MI,
|
|
MutableArrayRef<CalleeSavedInfo> CSI,
|
|
const TargetRegisterInfo *TRI) const override;
|
|
|
|
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
|
|
RegScavenger *RS) const override;
|
|
|
|
void processFunctionBeforeFrameFinalized(MachineFunction &MF,
|
|
RegScavenger *RS) const override;
|
|
|
|
protected:
|
|
bool hasFPImpl(const MachineFunction &MF) const override;
|
|
};
|
|
|
|
} // namespace llvm
|
|
|
|
#endif /* LLVM_LIB_TARGET_XTENSA_XTENSAFRAMELOWERING_H */
|