Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Public Member Functions |Static Public Member Functions |List of all members
llvm::Register Class Reference

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

#include "llvm/CodeGen/Register.h"

Public Member Functions

constexpr Register (unsigned Val=0)
 
constexpr Register (MCRegister Val)
 
constexprbool isStack ()const
 Return true if this is a stack slot.
 
constexprbool isVirtual ()const
 Return true if the specified register number is in the virtual register namespace.
 
constexprbool 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.
 
constexpr operator unsigned ()const
 
constexprunsigned id ()const
 
constexpr operator MCRegister ()const
 
MCRegister asMCReg ()const
 Utility to check-convert this value to aMCRegister.
 
constexprbool isValid ()const
 
constexprbool operator== (constRegister &Other)const
 Comparisons between register objects.
 
constexprbool operator!= (constRegister &Other)const
 
constexprbool operator== (constMCRegister &Other)const
 
constexprbool operator!= (constMCRegister &Other)const
 
constexprbool operator== (unsignedOther)const
 Comparisons against register constants.
 
constexprbool operator!= (unsignedOther)const
 
constexprbool operator== (intOther)const
 
constexprbool operator!= (intOther)const
 
constexprbool operator== (MCPhysRegOther)const
 
constexprbool operator!= (MCPhysRegOther)const
 

Static Public Member Functions

static constexprbool isStackSlot (unsigned Reg)
 isStackSlot - Sometimes it is useful to be able to store a non-negative frame index in a variable that normally holds a register.
 
static int stackSlot2Index (Register Reg)
 Compute the frame index from a register value representing a stack slot.
 
staticRegister index2StackSlot (int FI)
 Convert a non-negative frame index to a stack slot register value.
 
static constexprbool isPhysicalRegister (unsigned Reg)
 Return true if the specified register number is in the physical register namespace.
 
static constexprbool isVirtualRegister (unsigned Reg)
 Return true if the specified register number is in the virtual register namespace.
 
staticunsigned virtReg2Index (Register Reg)
 Convert a virtual register number to a 0-based index.
 
staticRegister index2VirtReg (unsignedIndex)
 Convert a 0-based index to a virtual register number.
 

Detailed Description

Wrapper class representing virtual and physical registers.

Should be passed by value.

Definition at line19 of fileRegister.h.

Constructor & Destructor Documentation

◆ Register()[1/2]

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

Definition at line23 of fileRegister.h.

◆ Register()[2/2]

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

Definition at line24 of fileRegister.h.

Member Function Documentation

◆ asMCReg()

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

Utility to check-convert this value to aMCRegister.

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

Definition at line110 of fileRegister.h.

Referencesassert(),isPhysical(), andisValid().

Referenced byllvm::TargetRegisterClass::contains(),llvm::VirtRegAuxInfo::copyHint(),llvm::BitTracker::MachineEvaluator::getRegBitWidth(),isCopyFeedingInvariantStore(),llvm::TargetRegisterInfo::regsOverlap(), andupdatePhysDepsDownwards().

◆ id()

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

Definition at line103 of fileRegister.h.

Referenced byllvm::DenseMapInfo< Register >::getHashValue(),llvm::ARMBankConflictHazardRecognizer::getHazardType(),getLibCallID(),getMaxPushPopReg(),llvm::MachineRegisterInfo::getRegAllocationHint(),llvm::hash_value(),INITIALIZE_PASS(),llvm::LoongArchAsmPrinter::PrintAsmOperand(), andllvm::PBQP::RegAlloc::GraphMetadata::setNodeIdForVReg().

◆ index2StackSlot()

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

Convert a non-negative frame index to a stack slot register value.

Definition at line58 of fileRegister.h.

Referencesassert(), andllvm::MCRegister::FirstStackSlot.

Referenced byllvm::LiveStacks::getOrCreateInterval(), andllvm::rdf::PhysicalRegisterInfo::getRegMaskId().

◆ index2VirtReg()

staticRegister llvm::Register::index2VirtReg(unsigned Index)
inlinestatic

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

This is the inverse operation ofVirtReg2IndexFunctor below.

Definition at line84 of fileRegister.h.

Referencesassert(),Index, andllvm::MCRegister::VirtualRegFlag.

Referenced byaddImplicitDefs(),llvm::LiveIntervals::addKillFlags(),llvm::LiveVariables::addNewBlock(),llvm::MachineRegisterInfo::addRegAllocationHint(),llvm::VirtRegAuxInfo::calculateSpillWeightsAndHints(),llvm::MachineRegisterInfo::clearVirtRegs(),llvm::DeadLaneDetector::computeSubRegisterLaneBitInfo(),llvm::MIRPrinter::convert(),llvm::MachineRegisterInfo::createIncompleteVirtualRegister(),llvm::SITargetLowering::finalizeLowering(),getAnySgprS1(),llvm::getLiveRegMap(),llvm::getLiveRegs(),llvm::SPIRV::ModuleAnalysisInfo::getOrCreateMBBRegister(),isSSA(),llvm::LiveIntervals::print(),llvm::LiveVariables::print(),llvm::VirtRegMap::print(),llvm::InstructionSelect::selectMachineFunction(),llvm::MachineRegisterInfo::setRegAllocationHint(),llvm::MachineBasicBlock::SplitCriticalEdge(),llvm::SIMachineFunctionInfo::usesAGPRs(), andllvm::MachineRegisterInfo::verifyUseLists().

◆ isPhysical()

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

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

Definition at line95 of fileRegister.h.

ReferencesisPhysicalRegister().

Referenced byllvm::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::GIMatchTableExecutor::executeMatchTable(),llvm::MachineInstr::findRegisterDefOperandIdx(),llvm::CoalescerPair::flip(),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::TargetRegisterInfo::getRegAllocationHints(),llvm::BitTracker::MachineEvaluator::getRegBitWidth(),llvm::getRegState(),llvm::X86InstrInfo::getUndefRegClearance(),INITIALIZE_PASS(),llvm::CoalescerPair::isCoalescable(),isIdenticalOp(),isLibCallInTailPosition(),isLocalCopy(),isMatchingStartStopPair(),llvm::SITargetLowering::legalizeTargetIndependentNode(),llvm::ARMBaseInstrInfo::loadRegFromStackSlot(),llvm::Thumb1InstrInfo::loadRegFromStackSlot(),llvm::Thumb2InstrInfo::loadRegFromStackSlot(),loadRegPairFromStackSlot(),llvm::TargetInstrInfo::lowerCopy(),MIIsInTerminatorSequence(),llvm::SIInstrInfo::moveToVALUImpl(),llvm::SIInstrInfo::optimizeCompareInstr(),llvm::X86InstrInfo::optimizeCompareInstr(),llvm::PeelSingleBlockLoop(),llvm::MachineOperand::print(),llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized(),llvm::TargetRegisterInfo::regsOverlap(),llvm::MachineRegisterInfo::replaceRegWith(),selectCopy(),storeRegPairToStackSlot(),llvm::Thumb1InstrInfo::storeRegToStackSlot(),llvm::MachineInstr::substituteRegister(), andllvm::SIInstrInfo::verifyInstruction().

◆ isPhysicalRegister()

static constexprbool llvm::Register::isPhysicalRegister(unsigned Reg)
inlinestaticconstexpr

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

Definition at line65 of fileRegister.h.

Referencesllvm::MCRegister::isPhysicalRegister().

Referenced byllvm::ARMBaseInstrInfo::AddDReg(),llvm::calculateDbgEntityHistory(),canCompareBeNewValueJump(),llvm::SelectionDAGBuilder::CopyValueToVirtualRegister(),llvm::M68kRegisterInfo::getMaximalPhysRegClass(),llvm::rdf::CopyPropagation::interpretAsCopy(),isEvenReg(),isPhysical(),llvm::rdf::RegisterRef::isRegId(),llvm::GenericScheduler::reschedulePhysReg(), andllvm::DwarfCompileUnit::updateSubprogramScopeDIE().

◆ isStack()

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

Return true if this is a stack slot.

Definition at line49 of fileRegister.h.

Referencesllvm::MCRegister::isStackSlot().

◆ isStackSlot()

static constexprbool llvm::Register::isStackSlot(unsigned Reg)
inlinestaticconstexpr

isStackSlot - Sometimes it is useful to be able to store a non-negative frame index in a variable that normally holds a register.

isStackSlot() returns true if Reg is in the range used for stack slots.

FIXME: remove in favor of member.

Definition at line44 of fileRegister.h.

Referencesllvm::MCRegister::isStackSlot().

Referenced byllvm::rdf::RegisterRef::isMaskId(), andllvm::printReg().

◆ isValid()

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

Definition at line115 of fileRegister.h.

Referencesllvm::MCRegister::NoRegister.

Referenced byaddConstantsToTrack(),addOpsFromMDNode(),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::X86InstrInfo::classifyLEAReg(),llvm::WebAssemblyDebugValueManager::cloneSink(),copySubReg(),llvm::SIRegisterInfo::eliminateFrameIndex(),llvm::X86FrameLowering::emitEpilogue(),llvm::HexagonDAGToDAGISel::emitFunctionEntryCode(),llvm::X86FrameLowering::emitPrologue(),generateAssignInstrs(),llvm::generateGroupInst(),llvm::SIInstrInfo::getAddNoCarry(),llvm::SPIRVGlobalRegistry::getOrCreateConstNullPtr(),llvm::SPIRVGlobalRegistry::getOrCreateOpTypeByOpcode(),llvm::SPIRVGlobalRegistry::getOrCreateOpTypeCoopMatr(),llvm::SPIRVGlobalRegistry::getOrCreateUndef(),llvm::X86TargetLowering::getRegForInlineAsmConstraint(),llvm::HexagonRegisterInfo::getReservedRegs(),getTestBitReg(),getTruncStoreByteOffset(),llvm::VirtRegMap::hasPreferredPhys(),INITIALIZE_PASS(),insertInlineAsmProcess(),isCandidate(),llvm::AMDGPULegalizerInfo::legalizeAddrSpaceCast(),llvm::AArch64InstrInfo::loadRegFromStackSlot(),llvm::SPIRVMCInstLower::lower(),llvm::SPIRVCallLowering::lowerCall(),llvm::PhiLoweringHelper::lowerPhis(),llvm::LegalizerHelper::lowerReadWriteRegister(),llvm::CombinerHelper::matchCombineAnyExtTrunc(),llvm::CombinerHelper::matchHoistLogicOpWithSameOpcodeHands(),popRegsFromStack(),llvm::HexagonFrameLowering::processFunctionBeforeFrameFinalized(), andprocessNewInstrs().

◆ isVirtual()

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

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

Definition at line91 of fileRegister.h.

ReferencesisVirtualRegister().

Referenced byllvm::MachineRegisterInfo::addRegAllocationHint(),llvm::Combiner::WorkListMaintainerImpl< Lvl >::addUsersToWorkList(),llvm::RegisterOperands::adjustLaneLiveness(),llvm::RegAllocBase::allocatePhysRegs(),llvm::VirtRegMap::assignVirt2Phys(),llvm::VirtRegMap::assignVirt2StackSlot(),attemptDebugCopyProp(),llvm::SIInstrInfo::buildExtractSubReg(),canCombine(),canCombineFPFusedMultiply(),canFoldCopy(),llvm::AArch64InstrInfo::canFoldIntoAddrMode(),llvm::X86InstrInfo::classifyLEAReg(),llvm::VirtRegMap::clearVirt(),cloneInstr(),llvm::PPCInstrInfo::combineRLWINM(),llvm::GISelKnownBits::computeKnownBitsImpl(),llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(),llvm::VirtRegAuxInfo::copyHint(),llvm::ARMBaseRegisterInfo::eliminateFrameIndex(),llvm::WebAssemblyRegisterInfo::eliminateFrameIndex(),llvm::R600TargetLowering::EmitInstrWithCustomInserter(),llvm::ThumbRegisterInfo::emitLoadConstPool(),llvm::PPCTargetLowering::EmitPartwordAtomicBinary(),emitThumbRegPlusImmInReg(),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::PPCInstrInfo::getFMAPatterns(),getFMULPatterns(),llvm::MachineInstrExpressionTrait::getHashValue(),getIndVarInfo(),llvm::AMDGPURegisterBankInfo::getInstrMapping(),getLanesWithProperty(),llvm::SIInstrInfo::getLiveRangeSplitOpcode(),llvm::VirtRegMap::getPhys(),llvm::MachineRegisterInfo::getRegAllocationHint(),llvm::PPCRegisterInfo::getRegAllocationHints(),llvm::TargetRegisterInfo::getRegAllocationHints(),llvm::MachineRegisterInfo::getRegAllocationHints(),llvm::BitTracker::MachineEvaluator::getRegBitWidth(),llvm::VirtRegMap::getShape(),llvm::MachineRegisterInfo::getSimpleHint(),llvm::VirtRegMap::getStackSlot(),llvm::getVRegSubRegDef(),hasAllNBitUsers(),llvm::VirtRegMap::hasPreferredPhys(),llvm::TargetInstrInfo::hasReassociableOperands(),llvm::RISCVInstrInfo::hasReassociableOperands(),hasSameValue(),INITIALIZE_PASS(),llvm::RegPressureTracker::initLiveThru(),isAGPRCopy(),isCopyFeedingInvariantStore(),llvm::MachineInstr::isIdenticalTo(),isLibCallInTailPosition(),llvm::TargetInstrInfo::isReallyTriviallyReMaterializable(),isSignExtendedW(),isTileRegDef(),isVirtualRegisterOperand(),IsWritingToVCCR(),llvm::SIInstrInfo::legalizeOperands(),llvm::AMDGPULegalizerInfo::loadInputValue(),llvm::AArch64InstrInfo::loadRegFromStackSlot(),llvm::Thumb2InstrInfo::loadRegFromStackSlot(),llvm::SIInstrInfo::loadRegFromStackSlot(),llvm::TargetRegisterInfo::lookThruCopyLike(),llvm::TargetRegisterInfo::lookThruSingleUseCopyChain(),llvm::LiveDebugVariables::LDVImpl::mapVirtReg(),MatchingStackOffset(),llvm::BitTracker::RegisterCell::meet(),llvm::SIInstrInfo::moveToVALUImpl(),oneUseDominatesOtherUses(),llvm::PPCInstrInfo::optimizeCompareInstr(),llvm::AArch64InstrInfo::optimizeCondBranch(),llvm::Thumb2InstrInfo::optimizeSelect(),llvm::ARMBaseInstrInfo::produceSameValue(),llvm::PPCInstrInfo::promoteInstr32To64ForElimEXTSW(),llvm::PSetIterator::PSetIterator(),llvm::BitTracker::MachineEvaluator::putCell(),llvm::TargetInstrInfo::reassociateOps(),llvm::RegPressureTracker::recede(),regIsPICBase(),llvm::WebAssemblyAsmPrinter::regToString(),rescheduleCanonically(),resultDependsOnExec(),llvm::rewriteT2FrameIndex(),llvm::SelectionDAGISel::runOnMachineFunction(),llvm::InstructionSelect::selectMachineFunction(),llvm::MachineRegisterInfo::setRegAllocationHint(),llvm::MachineRegisterInfo::shouldTrackSubRegLiveness(),llvm::LiveIntervals::shrinkToUses(),spillRegPairs(),llvm::stableHashValue(),llvm::AArch64InstrInfo::storeRegToStackSlot(),llvm::Thumb2InstrInfo::storeRegToStackSlot(),llvm::SIInstrInfo::storeRegToStackSlot(),tryChangeVGPRtoSGPRinCopy(),llvm::LegalizationArtifactCombiner::tryCombineInstruction(),llvm::ARMBaseRegisterInfo::updateRegAllocHint(),llvm::SIInstrInfo::usesConstantBus(),llvm::SIInstrInfo::verifyInstruction(), andllvm::VirtRegAuxInfo::weightCalcHelper().

◆ isVirtualRegister()

static constexprbool llvm::Register::isVirtualRegister(unsigned Reg)
inlinestaticconstexpr

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

Definition at line71 of fileRegister.h.

Referencesllvm::MCRegister::VirtualRegFlag.

Referenced byllvm::RegsForValue::AddInlineAsmOperands(),canFoldIntoCSel(),CheckForPhysRegDependency(),llvm::ScheduleDAGSDNodes::computeOperandLatency(),llvm::WebAssemblyInstrInfo::copyPhysReg(),definedBySignExtendingOp(),definedByZeroExtendingOp(),dominatesAllUsesOf(),llvm::FastISel::fastEmitInst_extractsubreg(),llvm::AArch64InstrInfo::foldMemoryOperandImpl(),genMaddR(),llvm::RegsForValue::getCopyFromRegs(),getLiveRange(),isFPR64(),llvm::PPCInstrInfo::isSignOrZeroExtended(),llvm::rdf::RegisterRef::isUnitId(),isVirtual(),llvm::VirtRegOrUnit::isVirtualReg(),MatchingStackOffset(),llvm::printVRegOrUnit(),removeCopies(),stripValuesNotDefiningMask(), andllvm::VirtRegOrUnit::VirtRegOrUnit().

◆ operator MCRegister()

constexpr llvm::Register::operatorMCRegister() const
inlineconstexpr

Definition at line105 of fileRegister.h.

◆ operator unsigned()

constexpr llvm::Register::operatorunsigned() const
inlineconstexpr

Definition at line101 of fileRegister.h.

◆ operator!=()[1/5]

constexprbool llvm::Register::operator!=(constMCRegisterOther) const
inlineconstexpr

Definition at line127 of fileRegister.h.

Referencesllvm::Other.

◆ operator!=()[2/5]

constexprbool llvm::Register::operator!=(constRegisterOther) const
inlineconstexpr

Definition at line121 of fileRegister.h.

Referencesllvm::Other.

◆ operator!=()[3/5]

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

Definition at line137 of fileRegister.h.

Referencesllvm::Other.

◆ operator!=()[4/5]

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

Definition at line142 of fileRegister.h.

Referencesllvm::Other.

◆ operator!=()[5/5]

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

Definition at line135 of fileRegister.h.

Referencesllvm::Other.

◆ operator==()[1/5]

constexprbool llvm::Register::operator==(constMCRegisterOther) const
inlineconstexpr

Definition at line124 of fileRegister.h.

Referencesllvm::Other.

◆ operator==()[2/5]

constexprbool llvm::Register::operator==(constRegisterOther) const
inlineconstexpr

Comparisons between register objects.

Definition at line118 of fileRegister.h.

Referencesllvm::Other.

◆ operator==()[3/5]

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

Definition at line136 of fileRegister.h.

Referencesllvm::Other.

◆ operator==()[4/5]

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

Definition at line139 of fileRegister.h.

Referencesllvm::Other.

◆ operator==()[5/5]

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

Comparisons against register constants.

E.g.

  • R == AArch64::WZR
  • R == 0

Definition at line134 of fileRegister.h.

Referencesllvm::Other.

◆ stackSlot2Index()

static int llvm::Register::stackSlot2Index(Register Reg)
inlinestatic

Compute the frame index from a register value representing a stack slot.

Definition at line52 of fileRegister.h.

Referencesassert(), andllvm::MCRegister::FirstStackSlot.

Referenced byllvm::rdf::PhysicalRegisterInfo::getMaskUnits(),llvm::rdf::PhysicalRegisterInfo::getRegMaskBits(),llvm::rdf::PhysicalRegisterInfo::print(), andllvm::printReg().

◆ virtReg2Index()

staticunsigned llvm::Register::virtReg2Index(Register Reg)
inlinestatic

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

The first virtual register in a function will get the index 0.

Definition at line77 of fileRegister.h.

Referencesassert().

Referenced bycheckFrameBase(),emitOperand(),llvm::VReg2SUnit::getSparseSetIndex(),llvm::WebAssemblyFunctionInfo::getWAReg(),llvm::WebAssemblyFunctionInfo::isVRegStackified(),llvm::VirtReg2IndexFunctor::operator()(),llvm::SPIRVInstPrinter::printOperand(),llvm::printVRegOrUnit(),llvm::SelectionDAGISel::runOnMachineFunction(),scavengeFrameVirtualRegsInBlock(),llvm::WebAssemblyFunctionInfo::setWAReg(),llvm::WebAssemblyFunctionInfo::stackifyVReg(),llvm::DeadLaneDetector::transferUsedLanes(),llvm::WebAssemblyFunctionInfo::unstackifyVReg(), andvirtRegIndex().

◆ virtRegIndex()

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

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

The first virtual register in a function will get the index 0.

Definition at line99 of fileRegister.h.

ReferencesvirtReg2Index().


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

Generated on Sun Jul 20 2025 19:35:39 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp