LLVM 20.0.0git
|
#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.
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 [] |
|
static |
Definition at line 502 of file RISCVFrameLowering.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::encodeSLEB128(), llvm::encodeULEB128(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TRI.
Referenced by createDefCFAExpression(), and createDefCFAOffset().
|
static |
Definition at line 529 of file RISCVFrameLowering.cpp.
References llvm::SmallString< InternalLen >::append(), appendScalableVectorExpression(), assert(), llvm::MCCFIInstruction::createEscape(), llvm::encodeULEB128(), llvm::printReg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase< Size_T >::size(), SPReg, llvm::SmallString< InternalLen >::str(), and TRI.
|
static |
Definition at line 559 of file RISCVFrameLowering.cpp.
References llvm::SmallString< InternalLen >::append(), appendScalableVectorExpression(), assert(), llvm::MCCFIInstruction::createEscape(), llvm::encodeULEB128(), llvm::printReg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorBase< Size_T >::size(), llvm::SmallString< InternalLen >::str(), and TRI.
|
static |
Definition at line 192 of file RISCVFrameLowering.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), llvm::MCCFIInstruction::createRestore(), llvm::RegState::Define, DL, llvm::MachineInstr::FrameDestroy, llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::CalleeSavedInfo::getReg(), llvm::RISCVABI::getSCSPReg(), llvm::MachineFunction::getSubtarget(), llvm::Function::hasFnAttribute(), MBB, MI, llvm::none_of(), RAReg, llvm::MachineInstrBuilder::setMIFlag(), llvm::MachineInstrBuilder::setMIFlags(), and TII.
Referenced by llvm::RISCVFrameLowering::emitEpilogue().
|
static |
Definition at line 126 of file RISCVFrameLowering.cpp.
References llvm::MachineInstrBuilder::addCFIIndex(), llvm::MachineFunction::addFrameInst(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), assert(), llvm::BuildMI(), llvm::MCCFIInstruction::createEscape(), llvm::RegState::Define, DL, llvm::MachineInstr::FrameSetup, llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::CalleeSavedInfo::getReg(), llvm::RISCVABI::getSCSPReg(), llvm::MachineFunction::getSubtarget(), llvm::Function::hasFnAttribute(), MBB, MI, llvm::none_of(), llvm::Offset, RAReg, llvm::MachineInstrBuilder::setMIFlag(), TII, and TRI.
Referenced by llvm::RISCVFrameLowering::emitPrologue().
|
static |
Definition at line 2021 of file RISCVFrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::MachineBasicBlock::addSuccessor(), llvm::BuildMI(), llvm::MachineFunction::CreateMachineBasicBlock(), DL, llvm::MachineBasicBlock::end(), llvm::MachineInstr::FrameSetup, llvm::fullyRecomputeLiveIns(), llvm::MachineBasicBlock::getBasicBlock(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::RISCVTargetLowering::getStackProbeSize(), llvm::MachineFunction::getSubtarget(), llvm::MachineFunction::insert(), MBB, MBBI, llvm::MachineInstrBuilder::setMIFlags(), llvm::MachineBasicBlock::splice(), SPReg, and TII.
|
static |
Definition at line 1452 of file RISCVFrameLowering.cpp.
References llvm::MachineFunction::getSubtarget(), llvm::RISCVSubtarget::hasStdExtCOrZca(), MBB, MI, and TII.
|
static |
Definition at line 89 of file RISCVFrameLowering.cpp.
References llvm::RISCVABI::ABI_ILP32E, and llvm::RISCVABI::ABI_LP64E.
Definition at line 1805 of file RISCVFrameLowering.cpp.
|
static |
Definition at line 246 of file RISCVFrameLowering.cpp.
References FPReg, llvm::CalleeSavedInfo::getFrameIdx(), llvm::MachineFunction::getInfo(), llvm::CalleeSavedInfo::getReg(), llvm::Register::id(), llvm_unreachable, and RAReg.
Referenced by llvm::RISCVFrameLowering::assignCalleeSavedSpillSlots(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitPrologue(), getRestoreLibCallName(), and getSpillLibCallName().
|
static |
Definition at line 373 of file RISCVFrameLowering.cpp.
References assert(), llvm::find_if(), FixedCSRFIMap, llvm::CalleeSavedInfo::getReg(), llvm::Register::id(), and P.
Referenced by llvm::RISCVFrameLowering::assignCalleeSavedSpillSlots().
|
static |
Definition at line 484 of file RISCVFrameLowering.cpp.
References llvm::find_if(), FixedCSRFIMap, llvm::MachineFunction::getInfo(), llvm::CalleeSavedInfo::getReg(), and P.
Referenced by llvm::RISCVFrameLowering::emitEpilogue(), and llvm::RISCVFrameLowering::emitPrologue().
Definition at line 341 of file RISCVFrameLowering.cpp.
References FPReg, llvm_unreachable, llvm::RISCVZC::RA, llvm::RISCVZC::RA_S0, llvm::RISCVZC::RA_S0_S1, llvm::RISCVZC::RA_S0_S11, llvm::RISCVZC::RA_S0_S2, llvm::RISCVZC::RA_S0_S3, llvm::RISCVZC::RA_S0_S4, llvm::RISCVZC::RA_S0_S5, llvm::RISCVZC::RA_S0_S6, llvm::RISCVZC::RA_S0_S7, llvm::RISCVZC::RA_S0_S8, llvm::RISCVZC::RA_S0_S9, and RAReg.
Referenced by llvm::RISCVFrameLowering::assignCalleeSavedSpillSlots().
|
static |
Definition at line 314 of file RISCVFrameLowering.cpp.
References getLibCallID().
Referenced by llvm::RISCVFrameLowering::restoreCalleeSavedRegisters().
|
static |
Definition at line 1812 of file RISCVFrameLowering.cpp.
References TRI.
|
static |
Definition at line 469 of file RISCVFrameLowering.cpp.
References llvm::CalleeSavedInfo::getFrameIdx(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getStackID(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::TargetStackID::ScalableVector.
Referenced by llvm::RISCVFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), and llvm::RISCVFrameLowering::spillCalleeSavedRegisters().
|
static |
Definition at line 1389 of file RISCVFrameLowering.cpp.
References llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getStackID(), llvm::MachineFunction::getSubtarget(), llvm::RISCVSubtarget::hasVInstructions(), llvm::RISCV::isRVVSpill(), MBB, MI, and llvm::TargetStackID::ScalableVector.
Referenced by llvm::RISCVFrameLowering::processFunctionBeforeFrameFinalized().
|
static |
Definition at line 287 of file RISCVFrameLowering.cpp.
References getLibCallID().
Referenced by llvm::RISCVFrameLowering::spillCalleeSavedRegisters().
|
static |
Definition at line 454 of file RISCVFrameLowering.cpp.
References llvm::TargetStackID::Default, llvm::CalleeSavedInfo::getFrameIdx(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getStackID(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::RISCVFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::getFrameIndexReference(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), and llvm::RISCVFrameLowering::spillCalleeSavedRegisters().
|
static |
Definition at line 1433 of file RISCVFrameLowering.cpp.
References llvm::MachineFunction::getSubtarget().
Referenced by llvm::RISCVFrameLowering::hasReservedCallFrame(), and llvm::RISCVFrameLowering::processFunctionBeforeFrameFinalized().
Definition at line 115 of file RISCVFrameLowering.cpp.
Referenced by llvm::RISCVFrameLowering::assignCalleeSavedSpillSlots(), getMaxPushPopReg(), getPushOrLibCallsSavedInfo(), llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(), and llvm::RISCVFrameLowering::spillCalleeSavedRegisters().
|
staticconstexpr |
Definition at line 105 of file RISCVFrameLowering.cpp.
Referenced by llvm::M68kFrameLowering::assignCalleeSavedSpillSlots(), llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), llvm::RISCVFrameLowering::determineCalleeSaves(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::CSKYFrameLowering::emitPrologue(), llvm::LoongArchFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::getFrameIndexReference(), getLibCallID(), getPushPopEncodingAndNum(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::PPCFrameLowering::replaceFPWithRealFP(), llvm::Thumb1FrameLowering::restoreCalleeSavedRegisters(), and llvm::Thumb1FrameLowering::spillCalleeSavedRegisters().
|
staticconstexpr |
Definition at line 111 of file RISCVFrameLowering.cpp.
Referenced by llvm::RISCVFrameLowering::determineCalleeSaves(), emitSCSEpilogue(), emitSCSPrologue(), getLibCallID(), getPushPopEncodingAndNum(), llvm::MCRegisterInfo::getRARegister(), and llvm::MCRegisterInfo::InitMCRegisterInfo().
|
staticconstexpr |
Definition at line 108 of file RISCVFrameLowering.cpp.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::RISCVFrameLowering::allocateStack(), llvm::AMDGPURegisterBankInfo::applyMappingDynStackAlloc(), createDefCFAExpression(), llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::CSKYFrameLowering::eliminateCallFramePseudoInstr(), llvm::LoongArchFrameLowering::eliminateCallFramePseudoInstr(), llvm::RISCVFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), llvm::CSKYFrameLowering::emitEpilogue(), llvm::LoongArchFrameLowering::emitEpilogue(), llvm::PPCFrameLowering::emitEpilogue(), llvm::RISCVFrameLowering::emitEpilogue(), llvm::SystemZXPLINKFrameLowering::emitEpilogue(), llvm::WebAssemblyFrameLowering::emitEpilogue(), llvm::PPCTargetLowering::emitProbedAlloca(), llvm::CSKYFrameLowering::emitPrologue(), llvm::LoongArchFrameLowering::emitPrologue(), llvm::PPCFrameLowering::emitPrologue(), llvm::RISCVFrameLowering::emitPrologue(), llvm::WebAssemblyFrameLowering::emitPrologue(), emitStackProbeInline(), llvm::LegalizerHelper::getDynStackAllocTargetPtr(), llvm::RISCVFrameLowering::getFrameIndexReference(), M68kOutgoingArgHandler::getStackAddress(), llvm::PPCFrameLowering::inlineStackProbe(), llvm::PPCInstrInfo::isTOCSaveMI(), llvm::LanaiTargetLowering::LowerDYNAMIC_STACKALLOC(), LowerDYNAMIC_STACKALLOC(), llvm::SITargetLowering::lowerDYNAMIC_STACKALLOCImpl(), and llvm::LegalizerHelper::lowerDynStackAlloc().