LLVM 20.0.0git
|
#include "Target/X86/X86RegisterInfo.h"
Public Member Functions | |
X86RegisterInfo (const Triple &TT) | |
unsigned | getNumSupportedRegs (const MachineFunction &MF) const override |
Return the number of registers for the function. | |
const TargetRegisterClass * | getMatchingSuperRegClass (const TargetRegisterClass *A, const TargetRegisterClass *B, unsigned Idx) const override |
getMatchingSuperRegClass - Return a subclass of the specified register class A so that each register in it has a sub-register of the specified sub-register index which is in the specified register class B. | |
const TargetRegisterClass * | getSubClassWithSubReg (const TargetRegisterClass *RC, unsigned Idx) const override |
const TargetRegisterClass * | getLargestLegalSuperClass (const TargetRegisterClass *RC, const MachineFunction &MF) const override |
bool | shouldRewriteCopySrc (const TargetRegisterClass *DefRC, unsigned DefSubReg, const TargetRegisterClass *SrcRC, unsigned SrcSubReg) const override |
const TargetRegisterClass * | getPointerRegClass (const MachineFunction &MF, unsigned Kind=0) const override |
getPointerRegClass - Returns a TargetRegisterClass used for pointer values. | |
const TargetRegisterClass * | getCrossCopyRegClass (const TargetRegisterClass *RC) const override |
getCrossCopyRegClass - Returns a legal register class to copy a register in the specified class to or from. | |
const TargetRegisterClass * | getGPRsForTailCall (const MachineFunction &MF) const |
getGPRsForTailCall - Returns a register class with registers that can be used in forming tail calls. | |
unsigned | getRegPressureLimit (const TargetRegisterClass *RC, MachineFunction &MF) const override |
const MCPhysReg * | getCalleeSavedRegs (const MachineFunction *MF) const override |
getCalleeSavedRegs - Return a null-terminated list of all of the callee-save registers on this target. | |
const MCPhysReg * | getIPRACSRegs (const MachineFunction *MF) const override |
getIPRACSRegs - This API can be removed when rbp is safe to optimized out when IPRA is on. | |
const MCPhysReg * | getCalleeSavedRegsViaCopy (const MachineFunction *MF) const |
const uint32_t * | getCallPreservedMask (const MachineFunction &MF, CallingConv::ID) const override |
const uint32_t * | getNoPreservedMask () const override |
const uint32_t * | getDarwinTLSCallPreservedMask () const |
BitVector | getReservedRegs (const MachineFunction &MF) const override |
getReservedRegs - Returns a bitset indexed by physical register number indicating if a register is a special register that has particular uses and should be considered unavailable at all times, e.g. | |
bool | isArgumentRegister (const MachineFunction &MF, MCRegister Reg) const override |
isArgumentReg - Returns true if Reg can be used as an argument to a function. | |
bool | isTileRegisterClass (const TargetRegisterClass *RC) const |
Return true if it is tile register class. | |
bool | isFixedRegister (const MachineFunction &MF, MCRegister PhysReg) const override |
Returns true if PhysReg is a fixed register. | |
void | adjustStackMapLiveOutMask (uint32_t *Mask) const override |
bool | hasBasePointer (const MachineFunction &MF) const |
bool | canRealignStack (const MachineFunction &MF) const override |
bool | shouldRealignStack (const MachineFunction &MF) const override |
void | eliminateFrameIndex (MachineBasicBlock::iterator II, unsigned FIOperandNum, Register BaseReg, int FIOffset) const |
bool | eliminateFrameIndex (MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override |
bool | eliminateFrameIndicesBackwards () const override |
Process frame indices in forwards block order because X86InstrInfo::getSPAdjust relies on it when searching for the ADJCALLSTACKUP pseudo following a call. | |
unsigned | findDeadCallerSavedReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI) const |
findDeadCallerSavedReg - Return a caller-saved register that isn't live when it reaches the "return" instruction. | |
Register | getFrameRegister (const MachineFunction &MF) const override |
unsigned | getPtrSizedFrameRegister (const MachineFunction &MF) const |
unsigned | getPtrSizedStackRegister (const MachineFunction &MF) const |
Register | getStackRegister () const |
Register | getBaseRegister () const |
Register | getFramePtr () const |
Returns physical register used as frame pointer. | |
unsigned | getSlotSize () const |
bool | getRegAllocationHints (Register VirtReg, ArrayRef< MCPhysReg > Order, SmallVectorImpl< MCPhysReg > &Hints, const MachineFunction &MF, const VirtRegMap *VRM, const LiveRegMatrix *Matrix) const override |
Definition at line 24 of file X86RegisterInfo.h.
Definition at line 53 of file X86RegisterInfo.cpp.
References llvm::X86_MC::initLLVMToSEHAndCVRegMapping().
|
override |
Definition at line 750 of file X86RegisterInfo.cpp.
References assert().
|
override |
Definition at line 798 of file X86RegisterInfo.cpp.
References llvm::TargetRegisterInfo::canRealignStack(), CantUseSP(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getRegInfo(), and MRI.
Referenced by llvm::X86InstrInfo::loadRegFromStackSlot(), and llvm::X86InstrInfo::storeRegToStackSlot().
void X86RegisterInfo::eliminateFrameIndex | ( | MachineBasicBlock::iterator | II, |
unsigned | FIOperandNum, | ||
Register | BaseReg, | ||
int | FIOffset | ||
) | const |
Definition at line 864 of file X86RegisterInfo.cpp.
References assert(), llvm::MachineOperand::ChangeToImmediate(), II, MI, and llvm::Offset.
|
override |
Definition at line 904 of file X86RegisterInfo.cpp.
References assert(), llvm::MachineOperand::ChangeToImmediate(), contains(), llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::StackOffset::getFixed(), llvm::X86FrameLowering::getFrameIndexReference(), llvm::X86FrameLowering::getFrameIndexReferenceSP(), llvm::MachineFunction::getFrameInfo(), llvm::MachineBasicBlock::getParent(), llvm::X86FrameLowering::getWin64EHFrameIndexRef(), llvm::getX86SubSuperRegister(), II, llvm::X86FrameLowering::Is64Bit, llvm::MachineBasicBlock::isEHFuncletEntry(), llvm::MachineFrameInfo::isFixedObjectIndex(), isFuncletReturnInstr(), MBB, MBBI, MI, llvm::Offset, and tryOptimizeLEAtoMOV().
|
inlineoverride |
Process frame indices in forwards block order because X86InstrInfo::getSPAdjust relies on it when searching for the ADJCALLSTACKUP pseudo following a call.
TODO: Fix this and return true like all other targets.
Definition at line 153 of file X86RegisterInfo.h.
unsigned X86RegisterInfo::findDeadCallerSavedReg | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator & | MBBI | ||
) | const |
findDeadCallerSavedReg - Return a caller-saved register that isn't live when it reaches the "return" instruction.
We can then pop a stack object to this register without worry about clobbering it.
Definition at line 984 of file X86RegisterInfo.cpp.
References llvm::MachineFunction::callsEHReturn(), llvm::MachineBasicBlock::end(), getGPRsForTailCall(), llvm::MachineBasicBlock::getParent(), llvm::MCRegAliasIterator::isValid(), MBB, MBBI, and Uses.
Referenced by llvm::X86FrameLowering::emitSPUpdate().
|
inline |
Definition at line 166 of file X86RegisterInfo.h.
Referenced by llvm::X86FrameLowering::determineCalleeSaves(), llvm::X86FrameLowering::emitPrologue(), llvm::X86FrameLowering::getFrameIndexReference(), getReservedRegs(), llvm::X86FrameLowering::restoreWin32EHStackPointers(), and llvm::X86FrameLowering::spillFPBP().
|
override |
getCalleeSavedRegs - Return a null-terminated list of all of the callee-save registers on this target.
Definition at line 288 of file X86RegisterInfo.cpp.
References llvm::CallingConv::AnyReg, assert(), llvm::MachineFunction::callsEHReturn(), CC, llvm::CallingConv::CFGuard_Check, llvm::CallingConv::Cold, llvm::CallingConv::CXX_FAST_TLS, F, llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getSubtarget(), llvm::X86Subtarget::getTargetLowering(), llvm::CallingConv::GHC, llvm::X86Subtarget::hasAVX(), llvm::X86Subtarget::hasAVX512(), llvm::Function::hasFnAttribute(), llvm::X86Subtarget::hasSSE1(), llvm::CallingConv::HiPE, llvm::CallingConv::Intel_OCL_BI, llvm::CallingConv::PreserveAll, llvm::CallingConv::PreserveMost, llvm::CallingConv::PreserveNone, llvm::X86TargetLowering::supportSwiftError(), llvm::CallingConv::SwiftTail, llvm::CallingConv::Win64, llvm::CallingConv::X86_64_SysV, llvm::CallingConv::X86_INTR, and llvm::CallingConv::X86_RegCall.
const MCPhysReg * X86RegisterInfo::getCalleeSavedRegsViaCopy | ( | const MachineFunction * | MF | ) | const |
Definition at line 422 of file X86RegisterInfo.cpp.
References assert(), llvm::CallingConv::CXX_FAST_TLS, llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), and llvm::X86MachineFunctionInfo::isSplitCSR().
|
override |
Definition at line 432 of file X86RegisterInfo.cpp.
References llvm::CallingConv::AnyReg, assert(), CC, llvm::CallingConv::CFGuard_Check, llvm::CallingConv::Cold, llvm::CallingConv::CXX_FAST_TLS, F, llvm::MachineFunction::getFunction(), llvm::MachineFunction::getSubtarget(), llvm::X86Subtarget::getTargetLowering(), llvm::CallingConv::GHC, llvm::X86Subtarget::hasAVX(), llvm::X86Subtarget::hasAVX512(), llvm::X86Subtarget::hasSSE1(), llvm::CallingConv::HiPE, llvm::CallingConv::Intel_OCL_BI, llvm::CallingConv::PreserveAll, llvm::CallingConv::PreserveMost, llvm::CallingConv::PreserveNone, llvm::X86TargetLowering::supportSwiftError(), llvm::CallingConv::SwiftTail, llvm::CallingConv::Win64, llvm::CallingConv::X86_64_SysV, llvm::CallingConv::X86_INTR, and llvm::CallingConv::X86_RegCall.
|
override |
getCrossCopyRegClass - Returns a legal register class to copy a register in the specified class to or from.
Returns NULL if it is possible to copy between a two registers of the specified class.
Definition at line 257 of file X86RegisterInfo.cpp.
Definition at line 543 of file X86RegisterInfo.cpp.
|
inline |
Returns physical register used as frame pointer.
This will always returns the frame pointer register, contrary to getFrameRegister() which returns the "base pointer" in situations involving a stack, frame and base pointer.
Definition at line 171 of file X86RegisterInfo.h.
Referenced by llvm::X86FrameLowering::getFrameIndexReference().
|
override |
Definition at line 1032 of file X86RegisterInfo.cpp.
References llvm::TargetFrameLowering::hasFP().
Referenced by llvm::X86FrameLowering::assignCalleeSavedSpillSlots(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMovesFullCFA(), llvm::X86FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitPrologue(), llvm::X86FrameLowering::getFrameIndexReference(), getPtrSizedFrameRegister(), llvm::X86FrameLowering::restoreWin32EHStackPointers(), and llvm::X86FrameLowering::spillFPBP().
const TargetRegisterClass * X86RegisterInfo::getGPRsForTailCall | ( | const MachineFunction & | MF | ) | const |
getGPRsForTailCall - Returns a register class with registers that can be used in forming tail calls.
Definition at line 243 of file X86RegisterInfo.cpp.
References F, llvm::MachineFunction::getFunction(), llvm::CallingConv::HiPE, and llvm::CallingConv::Win64.
Referenced by findDeadCallerSavedReg(), and getPointerRegClass().
|
override |
getIPRACSRegs - This API can be removed when rbp is safe to optimized out when IPRA is on.
Definition at line 418 of file X86RegisterInfo.cpp.
|
override |
Definition at line 110 of file X86RegisterInfo.cpp.
References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), getRegClass(), llvm::MachineFunction::getSubtarget(), llvm::X86Subtarget::hasAVX512(), I, and llvm::TargetRegisterClass::superclasses().
|
override |
getMatchingSuperRegClass - Return a subclass of the specified register class A so that each register in it has a sub-register of the specified sub-register index which is in the specified register class B.
Definition at line 97 of file X86RegisterInfo.cpp.
Definition at line 539 of file X86RegisterInfo.cpp.
|
override |
Return the number of registers for the function.
Definition at line 659 of file X86RegisterInfo.cpp.
References llvm::MachineFunction::getSubtarget().
|
override |
getPointerRegClass - Returns a TargetRegisterClass used for pointer values.
Definition at line 187 of file X86RegisterInfo.cpp.
References getGPRsForTailCall(), llvm::MachineFunction::getSubtarget(), llvm::TargetFrameLowering::hasFP(), llvm::X86Subtarget::isTarget64BitLP64(), llvm_unreachable, and llvm::X86FrameLowering::Uses64BitFramePtr.
unsigned X86RegisterInfo::getPtrSizedFrameRegister | ( | const MachineFunction & | MF | ) | const |
Definition at line 1038 of file X86RegisterInfo.cpp.
References getFrameRegister(), llvm::MachineFunction::getSubtarget(), llvm::getX86SubSuperRegister(), and llvm::X86Subtarget::isTarget64BitILP32().
Referenced by llvm::X86TargetLowering::getRegisterByName().
unsigned X86RegisterInfo::getPtrSizedStackRegister | ( | const MachineFunction & | MF | ) | const |
Definition at line 1047 of file X86RegisterInfo.cpp.
References getStackRegister(), llvm::MachineFunction::getSubtarget(), llvm::getX86SubSuperRegister(), and llvm::X86Subtarget::isTarget64BitILP32().
|
override |
Definition at line 1158 of file X86RegisterInfo.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), canHintShape(), llvm::SmallVectorImpl< T >::clear(), llvm::TargetRegisterClass::contains(), llvm::SmallSet< T, N, C >::count(), llvm::dbgs(), DisableRegAllocNDDHints, llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::format_hex(), llvm::TargetRegisterClass::getID(), llvm::X86::getNonNDVariant(), llvm::VirtRegMap::getPhys(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), getTileShape(), llvm::SmallSet< T, N, C >::insert(), llvm::is_contained(), llvm::Register::isPhysicalRegister(), LLVM_DEBUG, Matrix, MI, MRI, llvm::MCRegister::NoRegister, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and TRI.
|
override |
Definition at line 268 of file X86RegisterInfo.cpp.
References llvm::TargetRegisterClass::getID(), and llvm::TargetFrameLowering::hasFP().
|
override |
getReservedRegs - Returns a bitset indexed by physical register number indicating if a register is a special register that has particular uses and should be considered unavailable at all times, e.g.
SP, RA. This is used by register scavenger to determine what registers are free.
Definition at line 547 of file X86RegisterInfo.cpp.
References assert(), getBaseRegister(), llvm::X86MachineFunctionInfo::getBPClobberedByInvoke(), llvm::Function::getCallingConv(), llvm::MachineFunction::getContext(), llvm::X86MachineFunctionInfo::getFPClobberedByInvoke(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getSubtarget(), llvm::getX86SubSuperRegister(), llvm::CallingConv::GRAAL, llvm::X86Subtarget::hasAVX512(), hasBasePointer(), llvm::TargetFrameLowering::hasFP(), llvm::MCRegAliasIterator::isValid(), llvm::MCContext::reportError(), llvm::Reserved, and SubReg.
|
inline |
Definition at line 173 of file X86RegisterInfo.h.
Referenced by llvm::X86AsmPrinter::emitInstruction(), llvm::X86FrameLowering::getInitialCFAOffset(), llvm::X86TargetLowering::getReturnAddressFrameIndex(), llvm::X86MachineFunctionInfo::setRestoreBasePointer(), and llvm::X86FrameLowering::X86FrameLowering().
|
inline |
Definition at line 165 of file X86RegisterInfo.h.
Referenced by llvm::X86FrameLowering::getFrameIndexReference(), llvm::X86FrameLowering::getFrameIndexReferenceSP(), getPtrSizedStackRegister(), llvm::X86FrameLowering::getWin64EHFrameIndexRef(), llvm::X86FrameLowering::X86FrameLowering(), and llvm::X86TargetLowering::X86TargetLowering().
|
override |
Definition at line 85 of file X86RegisterInfo.cpp.
References Idx.
bool X86RegisterInfo::hasBasePointer | ( | const MachineFunction & | MF | ) | const |
Definition at line 774 of file X86RegisterInfo.cpp.
References CantUseSP(), EnableBasePointer, llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::X86MachineFunctionInfo::getStackPtrSaveMI(), and llvm::X86MachineFunctionInfo::hasPreallocatedCall().
Referenced by llvm::X86FrameLowering::canSimplifyCallFramePseudos(), llvm::X86FrameLowering::determineCalleeSaves(), llvm::X86FrameLowering::emitPrologue(), llvm::X86FrameLowering::getFrameIndexReference(), getReservedRegs(), and llvm::X86FrameLowering::spillFPBP().
|
override |
isArgumentReg - Returns true if Reg can be used as an argument to a function.
Definition at line 689 of file X86RegisterInfo.cpp.
References llvm::any_of(), CC, llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getSubtarget(), TRI, llvm::CallingConv::Win64, and llvm::CallingConv::X86_64_SysV.
|
override |
Returns true if PhysReg is a fixed register.
Definition at line 728 of file X86RegisterInfo.cpp.
References llvm::MachineFunction::getSubtarget(), llvm::TargetFrameLowering::hasFP(), and TRI.
bool X86RegisterInfo::isTileRegisterClass | ( | const TargetRegisterClass * | RC | ) | const |
Return true if it is tile register class.
Definition at line 745 of file X86RegisterInfo.cpp.
References llvm::TargetRegisterClass::getID().
|
override |
Definition at line 817 of file X86RegisterInfo.cpp.
References llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::TargetRegisterInfo::shouldRealignStack(), and llvm::CallingConv::X86_INTR.
|
override |
Definition at line 227 of file X86RegisterInfo.cpp.
References llvm::TargetRegisterClass::hasSuperClassEq(), and llvm::TargetRegisterInfo::shouldRewriteCopySrc().