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/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 Register getFPReg (const RISCVSubtarget &STI)
 
static Register getSPReg (const RISCVSubtarget &STI)
 
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 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)
 

Variables

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

◆ estimateFunctionSizeInBytes()

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

◆ getABIStackAlignment()

static Align getABIStackAlignment ( RISCVABI::ABI  ABI)
static

Definition at line 30 of file RISCVFrameLowering.cpp.

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

◆ getFPReg()

static Register getFPReg ( const RISCVSubtarget STI)
static

Definition at line 376 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

◆ 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

◆ 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

◆ getSPReg()

static Register getSPReg ( const RISCVSubtarget STI)
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:
= {
{ RISCV::X1, -1}, { RISCV::X8, -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}}

Definition at line 47 of file RISCVFrameLowering.cpp.

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