LLVM 22.0.0git
llvm::X86RegisterInfo Class Referencefinal

#include "Target/X86/X86RegisterInfo.h"

Inheritance diagram for llvm::X86RegisterInfo:
[legend]

Public Member Functions

 X86RegisterInfo (const Triple &TT)
unsigned getNumSupportedRegs (const MachineFunction &MF) const override
 Return the number of registers for the function.
const TargetRegisterClassgetMatchingSuperRegClass (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 TargetRegisterClassgetSubClassWithSubReg (const TargetRegisterClass *RC, unsigned Idx) const override
const TargetRegisterClassgetLargestLegalSuperClass (const TargetRegisterClass *RC, const MachineFunction &MF) const override
const TargetRegisterClassgetPointerRegClass (unsigned Kind=0) const override
 getPointerRegClass - Returns a TargetRegisterClass used for pointer values.
const TargetRegisterClassgetCrossCopyRegClass (const TargetRegisterClass *RC) const override
 getCrossCopyRegClass - Returns a legal register class to copy a register in the specified class to or from.
unsigned getRegPressureLimit (const TargetRegisterClass *RC, MachineFunction &MF) const override
const MCPhysReggetCalleeSavedRegs (const MachineFunction *MF) const override
 getCalleeSavedRegs - Return a null-terminated list of all of the callee-save registers on this target.
const MCPhysReggetIPRACSRegs (const MachineFunction *MF) const override
 getIPRACSRegs - This API can be removed when rbp is safe to optimized out when IPRA is on.
const MCPhysReggetCalleeSavedRegsViaCopy (const MachineFunction *MF) const
const uint32_tgetCallPreservedMask (const MachineFunction &MF, CallingConv::ID) const override
const uint32_tgetNoPreservedMask () const override
const uint32_tgetDarwinTLSCallPreservedMask () 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
Register getPtrSizedFrameRegister (const MachineFunction &MF) const
Register 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
const TargetRegisterClassconstrainRegClassToNonRex2 (const TargetRegisterClass *RC) const
bool isNonRex2RegClass (const TargetRegisterClass *RC) const
bool requiresRegisterScavenging (const MachineFunction &MF) const override

Detailed Description

Definition at line 25 of file X86RegisterInfo.h.

Constructor & Destructor Documentation

◆ X86RegisterInfo()

X86RegisterInfo::X86RegisterInfo ( const Triple & TT)
explicit

Definition at line 55 of file X86RegisterInfo.cpp.

References llvm::X86_MC::initLLVMToSEHAndCVRegMapping().

Member Function Documentation

◆ adjustStackMapLiveOutMask()

void X86RegisterInfo::adjustStackMapLiveOutMask ( uint32_t * Mask) const
override

Definition at line 701 of file X86RegisterInfo.cpp.

References assert().

◆ canRealignStack()

◆ constrainRegClassToNonRex2()

const TargetRegisterClass * X86RegisterInfo::constrainRegClassToNonRex2 ( const TargetRegisterClass * RC) const

◆ eliminateFrameIndex() [1/2]

void X86RegisterInfo::eliminateFrameIndex ( MachineBasicBlock::iterator II,
unsigned FIOperandNum,
Register BaseReg,
int FIOffset ) const

◆ eliminateFrameIndex() [2/2]

◆ eliminateFrameIndicesBackwards()

bool llvm::X86RegisterInfo::eliminateFrameIndicesBackwards ( ) const
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 150 of file X86RegisterInfo.h.

◆ findDeadCallerSavedReg()

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 965 of file X86RegisterInfo.cpp.

References llvm::LiveRegUnits::addLiveOuts(), llvm::LiveRegUnits::available(), llvm::MachineFunction::callsEHReturn(), llvm::MachineFunction::getRegInfo(), MBB, MBBI, MRI, and llvm::LiveRegUnits::stepBackward().

◆ getBaseRegister()

Register llvm::X86RegisterInfo::getBaseRegister ( ) const
inline

Definition at line 163 of file X86RegisterInfo.h.

Referenced by getReservedRegs().

◆ getCalleeSavedRegs()

◆ getCalleeSavedRegsViaCopy()

◆ getCallPreservedMask()

◆ getCrossCopyRegClass()

const TargetRegisterClass * X86RegisterInfo::getCrossCopyRegClass ( const TargetRegisterClass * RC) const
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 208 of file X86RegisterInfo.cpp.

◆ getDarwinTLSCallPreservedMask()

const uint32_t * X86RegisterInfo::getDarwinTLSCallPreservedMask ( ) const

Definition at line 494 of file X86RegisterInfo.cpp.

◆ getFramePtr()

Register llvm::X86RegisterInfo::getFramePtr ( ) const
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 168 of file X86RegisterInfo.h.

◆ getFrameRegister()

Register X86RegisterInfo::getFrameRegister ( const MachineFunction & MF) const
override

Definition at line 1012 of file X86RegisterInfo.cpp.

References llvm::TargetFrameLowering::hasFP().

Referenced by getPtrSizedFrameRegister().

◆ getIPRACSRegs()

const MCPhysReg * X86RegisterInfo::getIPRACSRegs ( const MachineFunction * MF) const
override

getIPRACSRegs - This API can be removed when rbp is safe to optimized out when IPRA is on.

Definition at line 369 of file X86RegisterInfo.cpp.

◆ getLargestLegalSuperClass()

◆ getMatchingSuperRegClass()

const TargetRegisterClass * X86RegisterInfo::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.

Definition at line 101 of file X86RegisterInfo.cpp.

References A(), and B().

◆ getNoPreservedMask()

const uint32_t * X86RegisterInfo::getNoPreservedMask ( ) const
override

Definition at line 490 of file X86RegisterInfo.cpp.

◆ getNumSupportedRegs()

unsigned X86RegisterInfo::getNumSupportedRegs ( const MachineFunction & MF) const
override

Return the number of registers for the function.

Definition at line 610 of file X86RegisterInfo.cpp.

References llvm::MachineFunction::getSubtarget().

◆ getPointerRegClass()

const TargetRegisterClass * X86RegisterInfo::getPointerRegClass ( unsigned Kind = 0) const
override

getPointerRegClass - Returns a TargetRegisterClass used for pointer values.

Definition at line 196 of file X86RegisterInfo.cpp.

References assert().

◆ getPtrSizedFrameRegister()

◆ getPtrSizedStackRegister()

◆ getRegAllocationHints()

◆ getRegPressureLimit()

unsigned X86RegisterInfo::getRegPressureLimit ( const TargetRegisterClass * RC,
MachineFunction & MF ) const
override

◆ getReservedRegs()

◆ getSlotSize()

unsigned llvm::X86RegisterInfo::getSlotSize ( ) const
inline

◆ getStackRegister()

Register llvm::X86RegisterInfo::getStackRegister ( ) const
inline

Definition at line 162 of file X86RegisterInfo.h.

Referenced by getPtrSizedStackRegister().

◆ getSubClassWithSubReg()

const TargetRegisterClass * X86RegisterInfo::getSubClassWithSubReg ( const TargetRegisterClass * RC,
unsigned Idx ) const
override

Definition at line 89 of file X86RegisterInfo.cpp.

◆ hasBasePointer()

◆ isArgumentRegister()

bool X86RegisterInfo::isArgumentRegister ( const MachineFunction & MF,
MCRegister Reg ) const
override

isArgumentReg - Returns true if Reg can be used as an argument to a function.

Definition at line 640 of file X86RegisterInfo.cpp.

References llvm::any_of(), llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getSubtarget(), TRI, llvm::CallingConv::Win64, and llvm::CallingConv::X86_64_SysV.

◆ isFixedRegister()

bool X86RegisterInfo::isFixedRegister ( const MachineFunction & MF,
MCRegister PhysReg ) const
override

Returns true if PhysReg is a fixed register.

Definition at line 679 of file X86RegisterInfo.cpp.

References llvm::MachineFunction::getSubtarget(), llvm::TargetFrameLowering::hasFP(), and TRI.

◆ isNonRex2RegClass()

bool X86RegisterInfo::isNonRex2RegClass ( const TargetRegisterClass * RC) const

Definition at line 1256 of file X86RegisterInfo.cpp.

References llvm::TargetRegisterClass::getID().

Referenced by getLargestLegalSuperClass().

◆ isTileRegisterClass()

bool X86RegisterInfo::isTileRegisterClass ( const TargetRegisterClass * RC) const

Return true if it is tile register class.

Definition at line 696 of file X86RegisterInfo.cpp.

References llvm::TargetRegisterClass::getID().

◆ requiresRegisterScavenging()

bool llvm::X86RegisterInfo::requiresRegisterScavenging ( const MachineFunction & MF) const
inlineoverride

Definition at line 182 of file X86RegisterInfo.h.

◆ shouldRealignStack()


The documentation for this class was generated from the following files: