LLVM 20.0.0git
Public Member Functions | List of all members
llvm::X86RegisterInfo Class Referencefinal

#include "Target/X86/X86RegisterInfo.h"

Inheritance diagram for llvm::X86RegisterInfo:
Inheritance graph
[legend]

Public Member Functions

 X86RegisterInfo (const Triple &TT)
 
unsigned getNumSupportedRegs (const MachineFunction &MF) const override
 Return the number of registers for the function.
 
int getSEHRegNum (unsigned i) const
 
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
 
bool shouldRewriteCopySrc (const TargetRegisterClass *DefRC, unsigned DefSubReg, const TargetRegisterClass *SrcRC, unsigned SrcSubReg) const override
 
const TargetRegisterClassgetPointerRegClass (const MachineFunction &MF, 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.
 
const TargetRegisterClassgetGPRsForTailCall (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 MCPhysReggetCalleeSavedRegs (const MachineFunction *MF) const override
 getCalleeSavedRegs - Return a null-terminated list of all of the callee-save registers on this target.
 
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
 
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
 

Detailed Description

Definition at line 24 of file X86RegisterInfo.h.

Constructor & Destructor Documentation

◆ X86RegisterInfo()

X86RegisterInfo::X86RegisterInfo ( const Triple TT)
explicit

Definition at line 54 of file X86RegisterInfo.cpp.

References llvm::X86_MC::initLLVMToSEHAndCVRegMapping().

Member Function Documentation

◆ adjustStackMapLiveOutMask()

void X86RegisterInfo::adjustStackMapLiveOutMask ( uint32_t Mask) const
override

Definition at line 736 of file X86RegisterInfo.cpp.

References assert().

◆ canRealignStack()

bool X86RegisterInfo::canRealignStack ( const MachineFunction MF) const
override

◆ eliminateFrameIndex() [1/2]

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

◆ eliminateFrameIndex() [2/2]

bool X86RegisterInfo::eliminateFrameIndex ( MachineBasicBlock::iterator  MI,
int  SPAdj,
unsigned  FIOperandNum,
RegScavenger RS = nullptr 
) const
override

◆ 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 153 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 970 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().

◆ getBaseRegister()

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

◆ getCalleeSavedRegs()

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

◆ getCalleeSavedRegsViaCopy()

const MCPhysReg * X86RegisterInfo::getCalleeSavedRegsViaCopy ( const MachineFunction MF) const

◆ getCallPreservedMask()

const uint32_t * X86RegisterInfo::getCallPreservedMask ( const MachineFunction MF,
CallingConv::ID  CC 
) const
override

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

◆ getDarwinTLSCallPreservedMask()

const uint32_t * X86RegisterInfo::getDarwinTLSCallPreservedMask ( ) const

Definition at line 538 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 171 of file X86RegisterInfo.h.

Referenced by llvm::X86FrameLowering::getFrameIndexReference().

◆ getFrameRegister()

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

◆ getGPRsForTailCall()

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().

◆ getLargestLegalSuperClass()

const TargetRegisterClass * X86RegisterInfo::getLargestLegalSuperClass ( const TargetRegisterClass RC,
const MachineFunction MF 
) const
override

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

References A, and B.

◆ getNoPreservedMask()

const uint32_t * X86RegisterInfo::getNoPreservedMask ( ) const
override

Definition at line 534 of file X86RegisterInfo.cpp.

◆ getNumSupportedRegs()

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

Return the number of registers for the function.

Definition at line 646 of file X86RegisterInfo.cpp.

References llvm::MachineFunction::getSubtarget().

◆ getPointerRegClass()

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

◆ getPtrSizedFrameRegister()

unsigned X86RegisterInfo::getPtrSizedFrameRegister ( const MachineFunction MF) const

◆ getPtrSizedStackRegister()

unsigned X86RegisterInfo::getPtrSizedStackRegister ( const MachineFunction MF) const

◆ getRegAllocationHints()

bool X86RegisterInfo::getRegAllocationHints ( Register  VirtReg,
ArrayRef< MCPhysReg Order,
SmallVectorImpl< MCPhysReg > &  Hints,
const MachineFunction MF,
const VirtRegMap VRM,
const LiveRegMatrix Matrix 
) const
override

◆ getRegPressureLimit()

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

◆ getReservedRegs()

BitVector X86RegisterInfo::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.

SP, RA. This is used by register scavenger to determine what registers are free.

Definition at line 542 of file X86RegisterInfo.cpp.

References assert(), CC, llvm::MachineOperand::clobbersPhysReg(), getBaseRegister(), llvm::Function::getCallingConv(), getCallPreservedMask(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getSubtarget(), llvm::getX86SubSuperRegister(), llvm::CallingConv::GRAAL, llvm::X86Subtarget::hasAVX512(), hasBasePointer(), llvm::X86FrameLowering::hasFP(), llvm::MCRegAliasIterator::isValid(), llvm::report_fatal_error(), llvm::Reserved, and SubReg.

◆ getSEHRegNum()

int X86RegisterInfo::getSEHRegNum ( unsigned  i) const

Definition at line 86 of file X86RegisterInfo.cpp.

◆ getSlotSize()

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

◆ getStackRegister()

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

◆ getSubClassWithSubReg()

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

Definition at line 91 of file X86RegisterInfo.cpp.

References Idx.

◆ hasBasePointer()

bool X86RegisterInfo::hasBasePointer ( const MachineFunction MF) const

◆ 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 676 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.

◆ isFixedRegister()

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

Returns true if PhysReg is a fixed register.

Definition at line 715 of file X86RegisterInfo.cpp.

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

◆ isTileRegisterClass()

bool X86RegisterInfo::isTileRegisterClass ( const TargetRegisterClass RC) const

Return true if it is tile register class.

Definition at line 732 of file X86RegisterInfo.cpp.

References llvm::TargetRegisterClass::getID().

◆ shouldRealignStack()

bool X86RegisterInfo::shouldRealignStack ( const MachineFunction MF) const
override

◆ shouldRewriteCopySrc()

bool X86RegisterInfo::shouldRewriteCopySrc ( const TargetRegisterClass DefRC,
unsigned  DefSubReg,
const TargetRegisterClass SrcRC,
unsigned  SrcSubReg 
) const
override

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