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. | |
Wrapper class representing virtual and physical registers.
Should be passed by value.
Definition at line19 of fileRegister.h.
| inlineconstexpr |
Definition at line23 of fileRegister.h.
| inlineconstexpr |
Definition at line24 of fileRegister.h.
| 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().
| 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().
| 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().
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().
| 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().
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().
| inlineconstexpr |
Return true if this is a stack slot.
Definition at line49 of fileRegister.h.
Referencesllvm::MCRegister::isStackSlot().
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().
| 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().
| 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().
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().
| inlineconstexpr |
Definition at line105 of fileRegister.h.
| inlineconstexpr |
Definition at line101 of fileRegister.h.
| inlineconstexpr |
Definition at line127 of fileRegister.h.
Referencesllvm::Other.
Definition at line121 of fileRegister.h.
Referencesllvm::Other.
| inlineconstexpr |
Definition at line137 of fileRegister.h.
Referencesllvm::Other.
Definition at line142 of fileRegister.h.
Referencesllvm::Other.
Definition at line135 of fileRegister.h.
Referencesllvm::Other.
| inlineconstexpr |
Definition at line124 of fileRegister.h.
Referencesllvm::Other.
| inlineconstexpr |
Definition at line136 of fileRegister.h.
Referencesllvm::Other.
Definition at line139 of fileRegister.h.
Referencesllvm::Other.
Comparisons against register constants.
E.g.
Definition at line134 of fileRegister.h.
Referencesllvm::Other.
| 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().
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().
| 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().