LLVM 20.0.0git
Functions | Variables
RISCVFrameLowering.cpp File Reference
#include "RISCVFrameLowering.h"
#include "RISCVMachineFunctionInfo.h"
#include "RISCVSubtarget.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/CodeGen/LivePhysRegs.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"
#include "llvm/Support/LEB128.h"
#include <algorithm>

Go to the source code of this file.

Functions

static Align getABIStackAlignment (RISCVABI::ABI ABI)
 
static void emitSCSPrologue (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL)
 
static void emitSCSEpilogue (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const DebugLoc &DL)
 
static int getLibCallID (const MachineFunction &MF, const std::vector< CalleeSavedInfo > &CSI)
 
static const chargetSpillLibCallName (const MachineFunction &MF, const std::vector< CalleeSavedInfo > &CSI)
 
static const chargetRestoreLibCallName (const MachineFunction &MF, const std::vector< CalleeSavedInfo > &CSI)
 
static std::pair< unsigned, unsignedgetPushPopEncodingAndNum (const Register MaxReg)
 
static Register getMaxPushPopReg (const MachineFunction &MF, const std::vector< CalleeSavedInfo > &CSI)
 
static SmallVector< CalleeSavedInfo, 8 > getUnmanagedCSI (const MachineFunction &MF, const std::vector< CalleeSavedInfo > &CSI)
 
static SmallVector< CalleeSavedInfo, 8 > getRVVCalleeSavedInfo (const MachineFunction &MF, const std::vector< CalleeSavedInfo > &CSI)
 
static SmallVector< CalleeSavedInfo, 8 > getPushOrLibCallsSavedInfo (const MachineFunction &MF, const std::vector< CalleeSavedInfo > &CSI)
 
static void appendScalableVectorExpression (const TargetRegisterInfo &TRI, SmallVectorImpl< char > &Expr, int FixedOffset, int ScalableOffset, llvm::raw_string_ostream &Comment)
 
static MCCFIInstruction createDefCFAExpression (const TargetRegisterInfo &TRI, Register Reg, uint64_t FixedOffset, uint64_t ScalableOffset)
 
static MCCFIInstruction createDefCFAOffset (const TargetRegisterInfo &TRI, Register Reg, uint64_t FixedOffset, uint64_t ScalableOffset)
 
static unsigned getScavSlotsNumForRVV (MachineFunction &MF)
 
static bool hasRVVFrameObject (const MachineFunction &MF)
 
static unsigned estimateFunctionSizeInBytes (const MachineFunction &MF, const RISCVInstrInfo &TII)
 
static unsigned getCalleeSavedRVVNumRegs (const Register &BaseReg)
 
static MCRegister getRVVBaseRegister (const RISCVRegisterInfo &TRI, const Register &Reg)
 
static void emitStackProbeInline (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, DebugLoc DL)
 

Variables

static constexpr Register FPReg = RISCV::X8
 
static constexpr Register SPReg = RISCV::X2
 
static constexpr Register RAReg = RISCV::X1
 
static const std::pair< MCPhysReg, int8_t > FixedCSRFIMap []
 

Function Documentation

◆ appendScalableVectorExpression()

static void appendScalableVectorExpression ( const TargetRegisterInfo TRI,
SmallVectorImpl< char > &  Expr,
int  FixedOffset,
int  ScalableOffset,
llvm::raw_string_ostream Comment 
)
static

◆ createDefCFAExpression()

static MCCFIInstruction createDefCFAExpression ( const TargetRegisterInfo TRI,
Register  Reg,
uint64_t  FixedOffset,
uint64_t  ScalableOffset 
)
static

◆ createDefCFAOffset()

static MCCFIInstruction createDefCFAOffset ( const TargetRegisterInfo TRI,
Register  Reg,
uint64_t  FixedOffset,
uint64_t  ScalableOffset 
)
static

◆ emitSCSEpilogue()

static void emitSCSEpilogue ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const DebugLoc DL 
)
static

◆ emitSCSPrologue()

static void emitSCSPrologue ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const DebugLoc DL 
)
static

◆ emitStackProbeInline()

static void emitStackProbeInline ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
DebugLoc  DL 
)
static

◆ estimateFunctionSizeInBytes()

static unsigned estimateFunctionSizeInBytes ( const MachineFunction MF,
const RISCVInstrInfo TII 
)
static

◆ getABIStackAlignment()

static Align getABIStackAlignment ( RISCVABI::ABI  ABI)
static

Definition at line 89 of file RISCVFrameLowering.cpp.

References llvm::RISCVABI::ABI_ILP32E, and llvm::RISCVABI::ABI_LP64E.

◆ getCalleeSavedRVVNumRegs()

static unsigned getCalleeSavedRVVNumRegs ( const Register BaseReg)
static

Definition at line 1805 of file RISCVFrameLowering.cpp.

◆ getLibCallID()

static int getLibCallID ( const MachineFunction MF,
const std::vector< CalleeSavedInfo > &  CSI 
)
static

◆ getMaxPushPopReg()

static Register getMaxPushPopReg ( const MachineFunction MF,
const std::vector< CalleeSavedInfo > &  CSI 
)
static

◆ getPushOrLibCallsSavedInfo()

static SmallVector< CalleeSavedInfo, 8 > getPushOrLibCallsSavedInfo ( const MachineFunction MF,
const std::vector< CalleeSavedInfo > &  CSI 
)
static

◆ getPushPopEncodingAndNum()

static std::pair< unsigned, unsigned > getPushPopEncodingAndNum ( const Register  MaxReg)
static

◆ getRestoreLibCallName()

static const char * getRestoreLibCallName ( const MachineFunction MF,
const std::vector< CalleeSavedInfo > &  CSI 
)
static

◆ getRVVBaseRegister()

static MCRegister getRVVBaseRegister ( const RISCVRegisterInfo TRI,
const Register Reg 
)
static

Definition at line 1812 of file RISCVFrameLowering.cpp.

References TRI.

◆ getRVVCalleeSavedInfo()

static SmallVector< CalleeSavedInfo, 8 > getRVVCalleeSavedInfo ( const MachineFunction MF,
const std::vector< CalleeSavedInfo > &  CSI 
)
static

◆ getScavSlotsNumForRVV()

static unsigned getScavSlotsNumForRVV ( MachineFunction MF)
static

◆ getSpillLibCallName()

static const char * getSpillLibCallName ( const MachineFunction MF,
const std::vector< CalleeSavedInfo > &  CSI 
)
static

◆ getUnmanagedCSI()

static SmallVector< CalleeSavedInfo, 8 > getUnmanagedCSI ( const MachineFunction MF,
const std::vector< CalleeSavedInfo > &  CSI 
)
static

◆ hasRVVFrameObject()

static bool hasRVVFrameObject ( const MachineFunction MF)
static

Variable Documentation

◆ FixedCSRFIMap

const std::pair<MCPhysReg, int8_t> FixedCSRFIMap[]
static
Initial value:
= {
{ RAReg, -1}, { FPReg, -2},
{ RISCV::X9, -3}, { RISCV::X18, -4},
{ RISCV::X19, -5}, { RISCV::X20, -6},
{ RISCV::X21, -7}, { RISCV::X22, -8},
{ RISCV::X23, -9}, { RISCV::X24, -10},
{ RISCV::X25, -11}, { RISCV::X26, -12},
{ RISCV::X27, -13}}
static constexpr Register FPReg
static constexpr Register RAReg

Definition at line 115 of file RISCVFrameLowering.cpp.

Referenced by llvm::RISCVFrameLowering::assignCalleeSavedSpillSlots(), getMaxPushPopReg(), getPushOrLibCallsSavedInfo(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), and llvm::RISCVFrameLowering::spillCalleeSavedRegisters().

◆ FPReg

constexpr Register FPReg = RISCV::X8
staticconstexpr

◆ RAReg

constexpr Register RAReg = RISCV::X1
staticconstexpr

◆ SPReg

constexpr Register SPReg = RISCV::X2
staticconstexpr