#include "LoongArchFrameLowering.h"
#include "LoongArchMachineFunctionInfo.h"
#include "LoongArchSubtarget.h"
#include "MCTargetDesc/LoongArchBaseInfo.h"
#include "MCTargetDesc/LoongArchMCTargetDesc.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/MC/MCDwarf.h"
usingnamespacellvm;
#define DEBUG_TYPE …
bool LoongArchFrameLowering::hasFP(const MachineFunction &MF) const { … }
bool LoongArchFrameLowering::hasBP(const MachineFunction &MF) const { … }
void LoongArchFrameLowering::adjustReg(MachineBasicBlock &MBB,
MachineBasicBlock::iterator MBBI,
const DebugLoc &DL, Register DestReg,
Register SrcReg, int64_t Val,
MachineInstr::MIFlag Flag) const { … }
void LoongArchFrameLowering::determineFrameLayout(MachineFunction &MF) const { … }
static uint64_t estimateFunctionSizeInBytes(const LoongArchInstrInfo *TII,
const MachineFunction &MF) { … }
static bool needScavSlotForCFR(MachineFunction &MF) { … }
void LoongArchFrameLowering::processFunctionBeforeFrameFinalized(
MachineFunction &MF, RegScavenger *RS) const { … }
void LoongArchFrameLowering::emitPrologue(MachineFunction &MF,
MachineBasicBlock &MBB) const { … }
void LoongArchFrameLowering::emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const { … }
uint64_t LoongArchFrameLowering::getFirstSPAdjustAmount(
const MachineFunction &MF) const { … }
void LoongArchFrameLowering::determineCalleeSaves(MachineFunction &MF,
BitVector &SavedRegs,
RegScavenger *RS) const { … }
bool LoongArchFrameLowering::hasReservedCallFrame(
const MachineFunction &MF) const { … }
MachineBasicBlock::iterator
LoongArchFrameLowering::eliminateCallFramePseudoInstr(
MachineFunction &MF, MachineBasicBlock &MBB,
MachineBasicBlock::iterator MI) const { … }
bool LoongArchFrameLowering::spillCalleeSavedRegisters(
MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
ArrayRef<CalleeSavedInfo> CSI, const TargetRegisterInfo *TRI) const { … }
StackOffset LoongArchFrameLowering::getFrameIndexReference(
const MachineFunction &MF, int FI, Register &FrameReg) const { … }
bool LoongArchFrameLowering::enableShrinkWrapping(
const MachineFunction &MF) const { … }