|
LLVM 24.0.0git
|
MCRegisterClass - Base class of TargetRegisterClass. More...
#include "llvm/MC/MCRegisterInfo.h"
Public Types | |
| using | iterator = const MCPhysReg* |
| using | const_iterator = const MCPhysReg* |
Public Member Functions | |
| unsigned | getID () const |
| getID() - Return the register class ID number. | |
| iterator | begin () const |
| begin/end - Return all of the registers in this class. | |
| iterator | end () const |
| unsigned | getNumRegs () const |
| getNumRegs - Return the number of registers in this class. | |
| MCRegister | getRegister (unsigned i) const |
| getRegister - Return the specified register in the class. | |
| ArrayRef< MCPhysReg > | getRegisters () const |
| bool | contains (MCRegister Reg) const |
| contains - Return true if the specified register is included in this register class. | |
| bool | contains (MCRegister Reg1, MCRegister Reg2) const |
| contains - Return true if both registers are in this class. | |
| unsigned | getSizeInBits () const |
| Return the size of the physical register in bits if we are able to determine it. | |
| uint8_t | getCopyCost () const |
| getCopyCost - Return the cost of copying a value between two registers in this class. | |
| bool | expensiveOrImpossibleToCopy () const |
| bool | isAllocatable () const |
| isAllocatable - Return true if this register class may be used to create virtual registers. | |
| bool | isBaseClass () const |
| Return true if this register class has a defined BaseClassOrder. | |
| bool | hasSubClass (const MCRegisterClass *RC) const |
| Return true if the specified TargetRegisterClass is a proper sub-class of this TargetRegisterClass. | |
| bool | hasSubClassEq (const MCRegisterClass *RC) const |
| Returns true if RC is a sub-class of or equal to this class. | |
| bool | hasSuperClass (const MCRegisterClass *RC) const |
| Return true if the specified MCRegisterClass is a proper super-class of this MCRegisterClass. | |
| bool | hasSuperClassEq (const MCRegisterClass *RC) const |
| Returns true if RC is a super-class of or equal to this class. | |
| const uint32_t * | getSubClassMask () const |
| Returns a bit vector of subclasses, including this one. | |
| const uint32_t * | getSuperRegClassMaskOffsets () const |
| Returns the relative offsets of this class's super-register class bit masks, one per entry of getSuperRegIndices(). | |
| const uint32_t * | getSuperRegClassMaskAt (uint32_t Offset) const |
| Returns the bit mask of register classes that the sub-register index belonging to Offset projects into this class, where Offset is an entry of getSuperRegClassMaskOffsets(). | |
| const uint16_t * | getSuperRegIndices () const |
| Returns a 0-terminated list of sub-register indices that project some super-register class into this register class. | |
| ArrayRef< unsigned > | superclasses () const |
| Returns a list of super-classes. | |
| LaneBitmask | getLaneMask () const |
| Returns the combination of all lane masks of register in this class. | |
Public Attributes | |
| const uint32_t | RegsOff |
| Relative offset to MCPhysReg array. | |
| const uint32_t | RegSetOff |
| Relative offset to uint8_t array. | |
| const uint32_t | NameIdx |
| const uint32_t | RegSizeInBits |
| const uint16_t | RegsSize |
| const MCPhysReg | RegSetBegin |
| Register denoted by first bit in RegSet. | |
| const uint16_t | RegSetSize |
| const uint16_t | ID |
| const uint8_t | CopyCost |
| const bool | Allocatable |
| const bool | BaseClass |
| const uint32_t | SubClassMaskOff |
| Relative offset to uint32_t array. | |
| const uint32_t | SuperRegMaskOffsetsOff |
| Relative offset to a uint32_t array holding, for each entry of getSuperRegIndices(), the relative offset of that entry's bit mask. | |
| const uint32_t | SuperRegIndicesOff |
| Relative offset to MCPhysReg array. | |
| const LaneBitmask | LaneMask |
| const uint8_t | AllocationPriority |
| Classes with a higher priority value are assigned first by register allocators using a greedy heuristic. | |
| const bool | GlobalPriority |
| const uint8_t | TSFlags |
| Configurable target specific flags. | |
| const uint8_t | SpillStackID |
| const bool | HasDisjunctSubRegs |
| Whether the class supports two (or more) disjunct subregister indices. | |
| const bool | CoveredBySubRegs |
| Whether a combination of subregisters can cover every register in the class. | |
| const uint32_t | SuperClassesOff |
| Relative offset to unsigned array. | |
| const uint16_t | SuperClassesSize |
MCRegisterClass - Base class of TargetRegisterClass.
Definition at line 37 of file MCRegisterInfo.h.
Definition at line 40 of file MCRegisterInfo.h.
Definition at line 39 of file MCRegisterInfo.h.
|
inline |
begin/end - Return all of the registers in this class.
Definition at line 86 of file MCRegisterInfo.h.
References RegsOff.
Referenced by allocateSGPR32InputImpl(), end(), llvm::HexagonBlockRanges::expandToSubRegs(), getRegister(), getRegisters(), getRegistersForValue(), and getRegistersForValue().
|
inline |
contains - Return true if the specified register is included in this register class.
This does not include virtual registers.
Definition at line 109 of file MCRegisterInfo.h.
References Reg, RegSetBegin, RegSetOff, and RegSetSize.
Referenced by addHints(), llvm::MachineFunction::addLiveIn(), llvm::SIRegisterInfo::buildSpillLoadStore(), canFoldCopy(), CheckVGPROverflow(), llvm::X86_MC::X86MCInstrAnalysis::clearsSuperRegisters(), llvm::PPCInstrInfo::ClobbersPredicate(), contains(), llvm::AMDGPUDisassembler::convertTrue16OpSel(), llvm::VirtRegAuxInfo::copyHint(), llvm::SIInstrInfo::copyPhysReg(), cvtVOP3DstOpSelOnly(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), estimateRSStackSizeLimit(), llvm::SIInstrInfo::expandPostRAPseudo(), llvm::SIInstrInfo::foldImmediate(), llvm::R600InstrInfo::getIndirectIndexBegin(), getLargestFPRegisterOrZero(), llvm::M68kRegisterInfo::getMatchingMegaReg(), llvm::MCRegisterInfo::getMatchingSuperReg(), llvm::AArch64RegisterInfo::getRegAllocationHints(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::PPCRegisterInfo::getRegAllocationHints(), llvm::X86RegisterInfo::getRegAllocationHints(), llvm::X86TargetLowering::getRegForInlineAsmConstraint(), llvm::AMDGPU::getVGPRPhysRegClass(), llvm::PPCInstrInfo::insertSelect(), IsAGPROperand(), llvm::SIInstrInfo::isLegalRegOperand(), isMemOperand(), llvm::HexagonMCInstrInfo::isPredReg(), llvm::AMDGPU::isRsrcIndexReg(), llvm::AMDGPU::isSGPR(), isValidVOPDSrc(), matchAliasCondition(), llvm::MIPS_MC::matchRegisterName(), llvm::ARMInstPrinter::printInst(), llvm::SIFrameLowering::restoreCalleeSavedRegisters(), llvm::rewriteT2FrameIndex(), llvm::CoalescerPair::setRegisters(), llvm::SystemZRegisterInfo::shouldCoalesce(), UpdateOperandRegClass(), and llvm::SIInstrInfo::verifyInstruction().
|
inline |
contains - Return true if both registers are in this class.
Definition at line 120 of file MCRegisterInfo.h.
References contains().
|
inline |
Definition at line 90 of file MCRegisterInfo.h.
References begin(), and RegsSize.
Referenced by getRegistersForValue(), and getRegistersForValue().
|
inline |
Definition at line 137 of file MCRegisterInfo.h.
References CopyCost.
Referenced by CheckForPhysRegDependency().
|
inline |
getCopyCost - Return the cost of copying a value between two registers in this class.
A negative number means the register class is very expensive to copy e.g. status flag register classes.
Definition at line 133 of file MCRegisterInfo.h.
References CopyCost.
Referenced by CheckForPhysRegDependency().
|
inline |
getID() - Return the register class ID number.
Definition at line 82 of file MCRegisterInfo.h.
References ID.
Referenced by llvm::RegsForValue::AddInlineAsmOperands(), llvm::HexagonEvaluator::composeWithSubRegIndex(), llvm::X86RegisterInfo::constrainRegClassToNonRex2(), llvm::RegisterBank::covers(), llvm::HexagonFrameLowering::determineCalleeSaves(), llvm::SITargetLowering::finalizeLowering(), llvm::HexagonRegisterInfo::getCallerSavedRegs(), llvm::WebAssembly::getCopyOpcodeForRegClass(), GetCostForDef(), llvm::SIRegisterInfo::getEquivalentVGPRClass(), llvm::HexagonRegisterInfo::getHexagonSubRegIndex(), llvm::ARMBaseRegisterInfo::getLargestLegalSuperClass(), llvm::X86RegisterInfo::getLargestLegalSuperClass(), llvm::SIRegisterInfo::getNumUsedPhysRegs(), llvm::AArch64RegisterInfo::getRegAllocationHints(), llvm::X86RegisterInfo::getRegAllocationHints(), llvm::AArch64RegisterBankInfo::getRegBankFromRegClass(), llvm::PPCRegisterBankInfo::getRegBankFromRegClass(), llvm::RISCVRegisterBankInfo::getRegBankFromRegClass(), llvm::SPIRVRegisterBankInfo::getRegBankFromRegClass(), llvm::AMDGPU::getRegBitWidth(), llvm::TargetRegisterInfo::getRegClassInfo(), getRegForPrinting(), llvm::AArch64RegisterInfo::getRegPressureLimit(), llvm::ARMBaseRegisterInfo::getRegPressureLimit(), llvm::MipsRegisterInfo::getRegPressureLimit(), llvm::PPCRegisterInfo::getRegPressureLimit(), llvm::SIRegisterInfo::getRegPressureLimit(), llvm::X86RegisterInfo::getRegPressureLimit(), llvm::AMDGPU::getVGPRWithMSBs(), hasSubClassEq(), INITIALIZE_PASS(), llvm::X86RegisterInfo::isNonRex2RegClass(), isTileRegister(), llvm::X86RegisterInfo::isTileRegisterClass(), IsWritingToVCCR(), llvm::WebAssemblyMCInstLower::lower(), llvm::HexagonTargetLowering::LowerFormalArguments(), llvm::InlineAsmLowering::lowerInlineAsm(), llvm::ResourcePriorityQueue::scheduledNode(), llvm::AMDGPUDAGToDAGISel::Select(), llvm::AArch64RegisterInfo::shouldCoalesce(), and llvm::HexagonRegisterInfo::shouldCoalesce().
|
inline |
Returns the combination of all lane masks of register in this class.
The lane masks of the registers are the combination of all lane masks of their subregisters. Returns 1 if there are no subregisters.
Definition at line 233 of file MCRegisterInfo.h.
References LaneMask.
Referenced by llvm::ScheduleDAGInstrs::getLaneMaskForMO(), and llvm::MachineRegisterInfo::getMaxLaneMaskForVReg().
|
inline |
getNumRegs - Return the number of registers in this class.
Definition at line 94 of file MCRegisterInfo.h.
References RegsSize.
Referenced by llvm::RegisterClassInfo::computePSetLimit(), constrainRegClass(), llvm::R600InstrInfo::getIndirectIndexBegin(), llvm::M68kRegisterInfo::getMaximalPhysRegClass(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), getRegister(), llvm::M68kRegisterInfo::getRegisterOrder(), and llvm::SystemZRegisterInfo::shouldCoalesce().
|
inline |
getRegister - Return the specified register in the class.
Definition at line 98 of file MCRegisterInfo.h.
References assert(), begin(), and getNumRegs().
Referenced by llvm::AMDGPUDisassembler::convertTrue16OpSel(), llvm::R600InstrInfo::getIndirectIndexBegin(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), getRegForPrinting(), llvm::MipsTargetLowering::getRegisterByName(), llvm::M68kRegisterInfo::getRegisterOrder(), llvm::AMDGPU::getVGPRWithMSBs(), and llvm::tryFoldSPUpdateIntoPushPop().
Definition at line 103 of file MCRegisterInfo.h.
References llvm::ArrayRef(), begin(), and RegsSize.
Referenced by llvm::SIMachineFunctionInfo::allocateVGPRSpillToAGPR(), llvm::RegAllocBase::getErrorAssignment(), llvm::SIRegisterInfo::getNumUsedPhysRegs(), and llvm::TargetRegisterInfo::getRawAllocationOrder().
|
inline |
Return the size of the physical register in bits if we are able to determine it.
This always returns zero for registers of targets that use HW modes, as we need more information to determine the size of registers in such cases. Use TargetRegisterInfo to cover them.
Definition at line 128 of file MCRegisterInfo.h.
References RegSizeInBits.
Referenced by CheckVGPROverflow().
Returns a bit vector of subclasses, including this one.
The vector is indexed by class IDs.
To use it, consider the returned array as a chunk of memory that contains an array of bits of size NumRegClasses. Each 32-bit chunk contains a bitset of the ID of the subclasses in big-endian style. I.e., the representation of the memory from left to right at the bit level looks like: [31 30 ... 1 0] [ 63 62 ... 33 32] ... [ XXX NumRegClasses NumRegClasses - 1 ... ] Where the number represents the class ID and XXX bits that should be ignored.
See the implementation of hasSubClassEq for an example of how it can be used.
Definition at line 187 of file MCRegisterInfo.h.
References SubClassMaskOff.
Referenced by llvm::TargetRegisterInfo::getAllocatableClass(), and hasSubClassEq().
Returns the bit mask of register classes that the sub-register index belonging to Offset projects into this class, where Offset is an entry of getSuperRegClassMaskOffsets().
Definition at line 204 of file MCRegisterInfo.h.
References llvm::Offset.
Returns the relative offsets of this class's super-register class bit masks, one per entry of getSuperRegIndices().
Identical masks are stored once and shared, so the masks of one class are not contiguous and cannot be reached by striding. Resolve an entry with getSuperRegClassMaskAt().
Definition at line 196 of file MCRegisterInfo.h.
References SuperRegMaskOffsetsOff.
Returns a 0-terminated list of sub-register indices that project some super-register class into this register class.
The list has an entry for each Idx such that:
There exists SuperRC where: For all Reg in SuperRC: this->contains(Reg:Idx)
Definition at line 216 of file MCRegisterInfo.h.
References SuperRegIndicesOff.
|
inline |
Return true if the specified TargetRegisterClass is a proper sub-class of this TargetRegisterClass.
Definition at line 150 of file MCRegisterInfo.h.
References hasSubClassEq().
Referenced by foldSimpleCrossClassCopies(), getCommonMinimalPhysRegClass(), llvm::M68kRegisterInfo::getMaximalPhysRegClass(), and hasSuperClass().
|
inline |
Returns true if RC is a sub-class of or equal to this class.
Definition at line 155 of file MCRegisterInfo.h.
References getID(), getSubClassMask(), and ID.
Referenced by llvm::MachineFunction::addLiveIn(), canFoldCopy(), llvm::SIRegisterInfo::getCompatibleSubRegClass(), hasSubClass(), hasSuperClassEq(), llvm::PPCInstrInfo::promoteInstr32To64ForElimEXTSW(), UpdateOperandRegClass(), and llvm::RegisterBank::verify().
|
inline |
Return true if the specified MCRegisterClass is a proper super-class of this MCRegisterClass.
Definition at line 162 of file MCRegisterInfo.h.
References hasSubClass().
|
inline |
Returns true if RC is a super-class of or equal to this class.
Definition at line 167 of file MCRegisterInfo.h.
References hasSubClassEq().
Referenced by llvm::AArch64InstrInfo::emitLdStWithAddr(), llvm::SIInstrInfo::foldMemoryOperandImpl(), llvm::PPCInstrInfo::getOperandLatency(), isFPR64(), isFRClass(), isGPR64(), isGRClass(), llvm::SIRegisterInfo::isProperlyAlignedRC(), isVKClass(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), and llvm::SystemZRegisterInfo::shouldCoalesce().
|
inline |
isAllocatable - Return true if this register class may be used to create virtual registers.
Definition at line 143 of file MCRegisterInfo.h.
References Allocatable.
Referenced by llvm::MachineRegisterInfo::createVirtualRegister(), llvm::TargetRegisterInfo::getAllocatableClass(), getAllocatableSetForRC(), and llvm::MachineRegisterInfo::setRegClass().
|
inline |
Return true if this register class has a defined BaseClassOrder.
Definition at line 146 of file MCRegisterInfo.h.
References BaseClass.
Returns a list of super-classes.
The classes are ordered by ID which is also a topological ordering from large to small classes. The list does NOT include the current class.
Definition at line 224 of file MCRegisterInfo.h.
References llvm::ArrayRef(), SuperClassesOff, and SuperClassesSize.
Referenced by llvm::HexagonRegisterInfo::getHexagonSubRegIndex(), llvm::ARMBaseRegisterInfo::getLargestLegalSuperClass(), llvm::PPCRegisterInfo::getLargestLegalSuperClass(), and llvm::X86RegisterInfo::getLargestLegalSuperClass().
Definition at line 53 of file MCRegisterInfo.h.
Referenced by isAllocatable().
Classes with a higher priority value are assigned first by register allocators using a greedy heuristic.
The value is in the range [0,31].
Definition at line 64 of file MCRegisterInfo.h.
Definition at line 54 of file MCRegisterInfo.h.
Referenced by isBaseClass().
Definition at line 52 of file MCRegisterInfo.h.
Referenced by expensiveOrImpossibleToCopy(), and getCopyCost().
Whether a combination of subregisters can cover every register in the class.
See also the CoveredBySubRegs description in Target.td.
Definition at line 76 of file MCRegisterInfo.h.
Referenced by llvm::DeadLaneDetector::transferUsedLanes().
Definition at line 67 of file MCRegisterInfo.h.
Whether the class supports two (or more) disjunct subregister indices.
Definition at line 73 of file MCRegisterInfo.h.
Referenced by llvm::ScheduleDAGInstrs::getLaneMaskForMO(), and llvm::MachineRegisterInfo::shouldTrackSubRegLiveness().
Definition at line 51 of file MCRegisterInfo.h.
Referenced by getID(), and hasSubClassEq().
| const LaneBitmask llvm::MCRegisterClass::LaneMask |
Definition at line 61 of file MCRegisterInfo.h.
Referenced by getLaneMask(), llvm::rdf::PhysicalRegisterInfo::mapTo(), llvm::rdf::AggressiveCopyPropagation::run(), llvm::rdf::CopyPropagation::run(), and llvm::DeadLaneDetector::transferUsedLanes().
Definition at line 45 of file MCRegisterInfo.h.
Register denoted by first bit in RegSet.
Definition at line 49 of file MCRegisterInfo.h.
Referenced by contains().
Relative offset to uint8_t array.
Definition at line 44 of file MCRegisterInfo.h.
Referenced by contains().
Definition at line 50 of file MCRegisterInfo.h.
Referenced by contains().
Definition at line 46 of file MCRegisterInfo.h.
Referenced by getSizeInBits().
Relative offset to MCPhysReg array.
Definition at line 43 of file MCRegisterInfo.h.
Referenced by begin().
Definition at line 47 of file MCRegisterInfo.h.
Referenced by end(), getNumRegs(), and getRegisters().
Definition at line 71 of file MCRegisterInfo.h.
Referenced by llvm::TargetRegisterInfo::getSpillStackID().
Relative offset to uint32_t array.
Definition at line 56 of file MCRegisterInfo.h.
Referenced by getSubClassMask().
Relative offset to unsigned array.
Definition at line 77 of file MCRegisterInfo.h.
Referenced by superclasses().
Definition at line 78 of file MCRegisterInfo.h.
Referenced by superclasses().
Relative offset to MCPhysReg array.
Definition at line 60 of file MCRegisterInfo.h.
Referenced by getSuperRegIndices().
Relative offset to a uint32_t array holding, for each entry of getSuperRegIndices(), the relative offset of that entry's bit mask.
Definition at line 59 of file MCRegisterInfo.h.
Referenced by getSuperRegClassMaskOffsets().
Configurable target specific flags.
Definition at line 70 of file MCRegisterInfo.h.
Referenced by llvm::RISCVInstrInfo::copyPhysRegVector(), llvm::RISCVRegisterInfo::findVRegWithEncoding(), llvm::SIRegisterInfo::getRegClassAlignmentNumBits(), llvm::SIRegisterInfo::getSubRegAlignmentNumBits(), llvm::SIRegisterInfo::hasAGPRs(), llvm::SIRegisterInfo::hasSGPRs(), llvm::SIRegisterInfo::hasVGPRs(), llvm::RISCVRegisterInfo::isRVVRegClass(), isTupleInsertInstr(), llvm::RISCVInstrInfo::isVRegCopy(), llvm::RISCVRegisterInfo::isVRNRegClass(), and llvm::RISCVRegisterInfo::isVRRegClass().