LLVM: llvm::Register Class Reference (original) (raw)

Wrapper class representing virtual and physical registers. More...

#include "[llvm/CodeGen/Register.h](Register%5F8h%5Fsource.html)"

Public Member Functions
constexpr Register (unsigned Val=0)
constexpr Register (MCRegister Val)
constexpr bool isStack () const
Return true if this is a stack slot.
constexpr bool isVirtual () const
Return true if the specified register number is in the virtual register namespace.
constexpr bool isPhysical () const
Return true if the specified register number is in the physical register namespace.
unsigned virtRegIndex () const
Convert a virtual register number to a 0-based index.
int stackSlotIndex () const
Compute the frame index from a register value representing a stack slot.
constexpr operator unsigned () const
constexpr unsigned id () const
constexpr operator MCRegister () const
MCRegister asMCReg () const
Utility to check-convert this value to a MCRegister.
constexpr bool isValid () const
constexpr bool operator== (const Register &Other) const
Comparisons between register objects.
constexpr bool operator!= (const Register &Other) const
constexpr bool operator== (const MCRegister &Other) const
constexpr bool operator!= (const MCRegister &Other) const
constexpr bool operator== (unsigned Other) const
Comparisons against register constants.
constexpr bool operator!= (unsigned Other) const
constexpr bool operator== (int Other) const
constexpr bool operator!= (int Other) const
constexpr bool operator== (MCPhysReg Other) const
constexpr bool operator!= (MCPhysReg Other) const
Register & operator++ ()
Operators to move from one register to another nearby register by adding an offset.
Register operator++ (int)
Register & operator+= (unsigned RHS)
Static Public Member Functions
static Register index2StackSlot (int FI)
Convert a non-negative frame index to a stack slot register value.
static constexpr bool isPhysicalRegister (unsigned Reg)
Return true if the specified register number is in the physical register namespace.
static constexpr bool isVirtualRegister (unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
static Register index2VirtReg (unsigned Index)
Convert a 0-based index to a virtual register number.

Wrapper class representing virtual and physical registers.

Should be passed by value.

Definition at line 20 of file Register.h.

Register() [1/2]

llvm::Register::Register ( unsigned Val = 0) inlineconstexpr

Register() [2/2]

llvm::Register::Register ( MCRegister Val) inlineconstexpr

asMCReg()

MCRegister llvm::Register::asMCReg ( ) const inline

Utility to check-convert this value to a MCRegister.

The caller is expected to have already validated that this Register is, indeed, physical.

Definition at line 107 of file Register.h.

References assert(), isPhysical(), and isValid().

Referenced by llvm::SIFrameLowering::assignCalleeSavedSpillSlotsImpl(), llvm::TargetRegisterClass::contains(), llvm::VirtRegAuxInfo::copyHint(), llvm::AArch64InstrInfo::copyPhysReg(), llvm::SystemZInstrInfo::copyPhysReg(), llvm::XtensaFrameLowering::emitEpilogue(), llvm::XtensaFrameLowering::emitPrologue(), llvm::SIInstrInfo::foldImmediate(), llvm::BitTracker::MachineEvaluator::getRegBitWidth(), isCopyFeedingInvariantStore(), llvm::SPIRVMCInstLower::lower(), and llvm::TargetRegisterInfo::regsOverlap().

id()

unsigned llvm::Register::id ( ) const inlineconstexpr

Definition at line 100 of file Register.h.

Referenced by llvm::TargetFrameLowering::getDwarfFrameBase(), llvm::NVPTXRegisterInfo::getDwarfRegNumForVirtReg(), llvm::ARMBankConflictHazardRecognizer::getHazardType(), llvm::MachineRegisterInfo::getRegAllocationHint(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::hash_value(), INITIALIZE_PASS(), llvm::RISCVSubtarget::isRegisterReservedByUser(), llvm::LoongArchAsmPrinter::PrintAsmOperand(), Register(), llvm::FastISel::selectExtractValue(), llvm::PBQP::RegAlloc::GraphMetadata::setNodeIdForVReg(), and llvm::stableHashValue().

index2StackSlot()

Register llvm::Register::index2StackSlot ( int FI) inlinestatic

index2VirtReg()

Convert a 0-based index to a virtual register number.

This is the inverse operation of VirtReg2IndexFunctor below.

Definition at line 72 of file Register.h.

References assert(), Register(), and VirtualRegFlag.

Referenced by addImplicitDefs(), llvm::LiveIntervals::addKillFlags(), llvm::LiveVariables::addNewBlock(), llvm::LiveVariables::addNewBlock(), llvm::MachineRegisterInfo::addRegAllocationHint(), llvm::VirtRegAuxInfo::calculateSpillWeightsAndHints(), llvm::MachineRegisterInfo::clearVirtRegs(), convertMRI(), llvm::MachineRegisterInfo::createIncompleteVirtualRegister(), llvm::SITargetLowering::finalizeLowering(), getAnySgprS1(), llvm::getLiveRegMap(), llvm::getLiveRegs(), isSSA(), llvm::LiveIntervals::print(), llvm::LiveVariables::print(), llvm::print(), llvm::VirtRegMap::print(), llvm::InstructionSelect::selectMachineFunction(), llvm::MachineRegisterInfo::setRegAllocationHint(), llvm::MachineBasicBlock::SplitCriticalEdge(), and llvm::MachineRegisterInfo::verifyUseLists().

isPhysical()

bool llvm::Register::isPhysical ( ) const inlineconstexpr

Return true if the specified register number is in the physical register namespace.

Definition at line 83 of file Register.h.

References isPhysicalRegister().

Referenced by llvm::DwarfExpression::addMachineReg(), llvm::MachineInstr::addRegisterDead(), llvm::MachineInstr::addRegisterKilled(), llvm::AnalyzePhysRegInBundle(), asMCReg(), canFoldCopy(), llvm::canReplaceReg(), llvm::X86InstrInfo::classifyLEAReg(), collectRegDefs(), llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::TargetRegisterClass::contains(), llvm::X86InstrInfo::describeLoadedValue(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::GIMatchTableExecutor::executeMatchTable(), llvm::MachineInstr::findRegisterDefOperandIdx(), llvm::SIInstrInfo::foldImmediate(), llvm::X86InstrInfo::foldMemoryOperandImpl(), foldVGPRCopyIntoRegSequence(), llvm::BitTracker::MachineEvaluator::getCell(), llvm::AArch64RegisterBankInfo::getInstrMapping(), llvm::SIInstrInfo::getInstructionUniformity(), getMopState(), llvm::HexagonInstrInfo::getOperandLatency(), llvm::ARMBaseRegisterInfo::getRegAllocationHints(), llvm::RISCVRegisterInfo::getRegAllocationHints(), llvm::SIRegisterInfo::getRegAllocationHints(), llvm::SystemZRegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::X86RegisterInfo::getRegAllocationHints(), llvm::BitTracker::MachineEvaluator::getRegBitWidth(), llvm::getRegState(), llvm::X86InstrInfo::getUndefRegClearance(), INITIALIZE_PASS(), isIdenticalOp(), isLibCallInTailPosition(), isLocalCopy(), isMatchingStartStopPair(), isPhysical(), llvm::SITargetLowering::legalizeTargetIndependentNode(), llvm::ARMBaseInstrInfo::loadRegFromStackSlot(), llvm::Thumb1InstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), loadRegPairFromStackSlot(), lookUpCopyChain(), llvm::TargetInstrInfo::lowerCopy(), MIIsInTerminatorSequence(), llvm::SIInstrInfo::moveToVALUImpl(), llvm::SIInstrInfo::optimizeCompareInstr(), llvm::X86InstrInfo::optimizeCompareInstr(), llvm::PeelSingleBlockLoop(), llvm::TargetRegisterInfo::regsOverlap(), llvm::MachineRegisterInfo::replaceRegWith(), selectCopy(), selectCopy(), selectCopy(), storeRegPairToStackSlot(), llvm::Thumb1InstrInfo::storeRegToStackSlot(), llvm::MachineInstr::substituteRegister(), and llvm::SIInstrInfo::verifyInstruction().

isPhysicalRegister()

constexpr bool llvm::Register::isPhysicalRegister ( unsigned Reg) inlinestaticconstexpr

isStack()

bool llvm::Register::isStack ( ) const inlineconstexpr

isValid()

bool llvm::Register::isValid ( ) const inlineconstexpr

Definition at line 112 of file Register.h.

References llvm::MCRegister::NoRegister.

Referenced by addConstantsToTrack(), llvm::GISelAddressing::aliasIsKnownForLoadStore(), asMCReg(), llvm::HexagonFrameLowering::assignCalleeSavedSpillSlots(), llvm::buildAtomicCompareExchangeInst(), llvm::buildBarrierInst(), llvm::SPIRVGlobalRegistry::buildConstantFP(), llvm::SPIRVGlobalRegistry::buildConstantInt(), llvm::SPIRVGlobalRegistry::buildConstantSampler(), llvm::buildMemSemanticsReg(), llvm::buildNDRange(), llvm::buildScopeReg(), llvm::LegalizerHelper::buildVariableShiftPart(), llvm::AArch64TargetLowering::changeStreamingMode(), llvm::X86InstrInfo::classifyLEAReg(), llvm::WebAssemblyDebugValueManager::cloneSink(), copySubReg(), describeORRLoadedValue(), llvm::SIRegisterInfo::eliminateFrameIndex(), llvm::X86FrameLowering::emitEpilogue(), llvm::HexagonDAGToDAGISel::emitFunctionEntryCode(), llvm::X86FrameLowering::emitPrologue(), findLoopIncrementValue(), generateAssignInstrs(), llvm::generateGroupInst(), llvm::SIInstrInfo::getAddNoCarry(), llvm::SPIRVGlobalRegistry::getOrCreateConstNullPtr(), llvm::SPIRVGlobalRegistry::getOrCreateUndef(), llvm::X86TargetLowering::getRegForInlineAsmConstraint(), llvm::HexagonRegisterInfo::getReservedRegs(), getTestBitReg(), getTruncStoreByteOffset(), INITIALIZE_PASS(), llvm::RISCVInstrInfo::insertIndirectBranch(), insertInlineAsmProcess(), isCandidate(), llvm::AMDGPULegalizerInfo::legalizeAddrSpaceCast(), llvm::AArch64InstrInfo::loadRegFromStackSlot(), llvm::SPIRVCallLowering::lowerCall(), llvm::PhiLoweringHelper::lowerPhis(), llvm::CombinerHelper::matchCombineAnyExtTrunc(), llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(), operator++(), operator+=(), and popRegsFromStack().

isVirtual()

bool llvm::Register::isVirtual ( ) const inlineconstexpr

Return true if the specified register number is in the virtual register namespace.

Definition at line 79 of file Register.h.

References isVirtualRegister().

Referenced by llvm::MachineRegisterInfo::addRegAllocationHint(), llvm::Combiner::WorkListMaintainerImpl< Lvl >::addUsersToWorkList(), llvm::RegAllocBase::allocatePhysRegs(), llvm::VirtRegMap::assignVirt2Phys(), llvm::VirtRegMap::assignVirt2StackSlot(), llvm::VirtRegMap::assignVirt2StackSlot(), attemptDebugCopyProp(), llvm::SIInstrInfo::buildExtractSubReg(), llvm::AMDGPULegalizerInfo::buildLoadInputValue(), canCombine(), canCombine(), canCombine(), canCombineFPFusedMultiply(), canFoldCopy(), llvm::AArch64InstrInfo::canFoldIntoAddrMode(), llvm::X86InstrInfo::classifyLEAReg(), llvm::VirtRegMap::clearVirt(), cloneInstr(), llvm::PPCInstrInfo::combineRLWINM(), llvm::TargetInstrInfo::commuteInstructionImpl(), llvm::GISelValueTracking::computeKnownBitsImpl(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), llvm::VirtRegAuxInfo::copyHint(), llvm::WebAssemblyInstrInfo::copyPhysReg(), llvm::ARMBaseRegisterInfo::eliminateFrameIndex(), llvm::WebAssemblyRegisterInfo::eliminateFrameIndex(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::ThumbRegisterInfo::emitLoadConstPool(), llvm::PPCTargetLowering::EmitPartwordAtomicBinary(), emitPseudoXVINSGR2VR(), emitThumbRegPlusImmInReg(), llvm::FastISel::fastEmitInst_extractsubreg(), findLoopIncrementValue(), findRedundantFlagInstr(), llvm::SIInstrInfo::foldImmediate(), llvm::SystemZInstrInfo::foldImmediate(), llvm::AArch64InstrInfo::foldMemoryOperandImpl(), llvm::SIInstrInfo::foldMemoryOperandImpl(), llvm::SystemZInstrInfo::foldMemoryOperandImpl(), genFNegatedMAD(), genFusedMultiply(), genMaddR(), getCallTargetRegOpnd(), llvm::BitTracker::MachineEvaluator::getCell(), getCopyRegClasses(), getDefRegMask(), llvm::NVPTXRegisterInfo::getDwarfRegNumForVirtReg(), getEffectiveImm(), llvm::PPCInstrInfo::getFMAPatterns(), getFMULPatterns(), llvm::MachineInstrExpressionTrait::getHashValue(), getIndVarInfo(), llvm::AMDGPURegisterBankInfo::getInstrMapping(), llvm::SIInstrInfo::getLiveRangeSplitOpcode(), getMinimumVLForVSLIDEDOWN_VX(), llvm::VirtRegMap::getPhys(), llvm::MachineRegisterInfo::getRegAllocationHint(), llvm::MachineRegisterInfo::getRegAllocationHints(), llvm::PPCRegisterInfo::getRegAllocationHints(), llvm::RISCVRegisterInfo::getRegAllocationHints(), llvm::TargetRegisterInfo::getRegAllocationHints(), llvm::BitTracker::MachineEvaluator::getRegBitWidth(), llvm::VirtRegMap::getShape(), llvm::MachineRegisterInfo::getSimpleHint(), llvm::VirtRegMap::getStackSlot(), llvm::getVRegSubRegDef(), hasAllNBitUsers(), hasAllNBitUsers(), llvm::RISCVInstrInfo::hasReassociableOperands(), llvm::TargetInstrInfo::hasReassociableOperands(), hasSameValue(), INITIALIZE_PASS(), llvm::AArch64InstrInfo::insertSelect(), isAGPRCopy(), llvm::WebAssembly::isChild(), isCopyFeedingInvariantStore(), llvm::MachineInstr::isIdenticalTo(), isLibCallInTailPosition(), llvm::TargetInstrInfo::isReMaterializableImpl(), isSignExtendedW(), isSignExtendedW(), isTileRegDef(), isVirtualRegisterOperand(), IsWritingToVCCR(), llvm::SIInstrInfo::legalizeOperands(), llvm::AArch64InstrInfo::loadRegFromStackSlot(), llvm::SIInstrInfo::loadRegFromStackSlot(), llvm::Thumb2InstrInfo::loadRegFromStackSlot(), llvm::TargetRegisterInfo::lookThruCopyLike(), llvm::TargetRegisterInfo::lookThruSingleUseCopyChain(), llvm::LiveDebugVariables::LDVImpl::mapVirtReg(), MatchingStackOffset(), llvm::SwingSchedulerDAG::mayOverlapInLaterIter(), llvm::BitTracker::RegisterCell::meet(), llvm::SIInstrInfo::moveToVALUImpl(), oneUseDominatesOtherUses(), llvm::PPCInstrInfo::optimizeCompareInstr(), llvm::AArch64InstrInfo::optimizeCondBranch(), llvm::Thumb2InstrInfo::optimizeSelect(), llvm::ARMBaseInstrInfo::produceSameValue(), llvm::PPCInstrInfo::promoteInstr32To64ForElimEXTSW(), llvm::BitTracker::MachineEvaluator::putCell(), llvm::TargetInstrInfo::reassociateOps(), llvm::WebAssemblyAsmPrinter::regToString(), llvm::SIInstrInfo::regUsesConstantBus(), rescheduleCanonically(), llvm::rewriteT2FrameIndex(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::InstructionSelect::selectMachineFunction(), llvm::MachineRegisterInfo::setRegAllocationHint(), llvm::MachineRegisterInfo::shouldTrackSubRegLiveness(), llvm::LiveIntervals::shrinkToUses(), llvm::stableHashValue(), llvm::AArch64InstrInfo::storeRegToStackSlot(), llvm::SIInstrInfo::storeRegToStackSlot(), llvm::Thumb2InstrInfo::storeRegToStackSlot(), tryChangeVGPRtoSGPRinCopy(), llvm::LegalizationArtifactCombiner::tryCombineInstruction(), llvm::ARMBaseRegisterInfo::updateRegAllocHint(), llvm::RISCVRegisterInfo::updateRegAllocHint(), llvm::SIInstrInfo::usesConstantBus(), llvm::SIInstrInfo::verifyInstruction(), virtRegIndex(), and llvm::VirtRegAuxInfo::weightCalcHelper().

isVirtualRegister()

constexpr bool llvm::Register::isVirtualRegister ( unsigned Reg) inlinestaticconstexpr

Return true if the specified register number is in the virtual register namespace.

Definition at line 66 of file Register.h.

References VirtualRegFlag.

Referenced by canFoldIntoCSel(), definedBySignExtendingOp(), definedByZeroExtendingOp(), dominatesAllUsesOf(), llvm::AArch64InstrInfo::foldMemoryOperandImpl(), genMaddR(), if(), isFPR64(), llvm::PPCInstrInfo::isSignOrZeroExtended(), isVirtual(), llvm::VirtRegOrUnit::isVirtualReg(), MatchingStackOffset(), removeCopies(), and llvm::VirtRegOrUnit::VirtRegOrUnit().

operator MCRegister()

llvm::Register::operator MCRegister ( ) const inlineconstexpr

operator unsigned()

llvm::Register::operator unsigned ( ) const inlineconstexpr

operator!=() [1/5]

operator!=() [2/5]

operator!=() [3/5]

bool llvm::Register::operator!= ( int Other) const inlineconstexpr

operator!=() [4/5]

bool llvm::Register::operator!= ( MCPhysReg Other) const inlineconstexpr

operator!=() [5/5]

bool llvm::Register::operator!= ( unsigned Other) const inlineconstexpr

operator++() [1/2]

Register & llvm::Register::operator++ ( ) inline

operator++() [2/2]

Register llvm::Register::operator++ ( int ) inline

operator+=()

operator==() [1/5]

operator==() [2/5]

operator==() [3/5]

bool llvm::Register::operator== ( int Other) const inlineconstexpr

operator==() [4/5]

bool llvm::Register::operator== ( MCPhysReg Other) const inlineconstexpr

operator==() [5/5]

bool llvm::Register::operator== ( unsigned Other) const inlineconstexpr

Comparisons against register constants.

E.g.

Definition at line 131 of file Register.h.

References llvm::Other.

stackSlotIndex()

int llvm::Register::stackSlotIndex ( ) const inline

virtRegIndex()

unsigned llvm::Register::virtRegIndex ( ) const inline

MaxFrameIndexBitwidth

unsigned llvm::Register::MaxFrameIndexBitwidth = 30 staticconstexpr

StackSlotMask

StackSlotZero

VirtualRegFlag

unsigned llvm::Register::VirtualRegFlag = 1u << 31 staticconstexpr

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