LLVM 20.0.0git |
Holds all the information related to register banks.More...
#include "llvm/CodeGen/RegisterBankInfo.h"
Classes | |
class | InstructionMapping |
Helper class that represents how the value of an instruction may be mapped and what is the related cost of such mapping.More... | |
class | OperandsMapper |
Helper class used to get/create the virtual registers that will be used to replace theMachineOperand when applying a mapping.More... | |
struct | PartialMapping |
Helper struct that represents how a value is partially mapped into a register.More... | |
struct | ValueMapping |
Helper struct that represents how a value is mapped through different register banks.More... | |
Public Types | |
using | InstructionMappings =SmallVector<constInstructionMapping *, 4 > |
Convenient type to represent the alternatives for mapping an instruction. | |
Public Member Functions | |
constRegisterBank * | getRegBankFromConstraints (constMachineInstr &MI,unsigned OpIdx,constTargetInstrInfo &TII,constMachineRegisterInfo &MRI)const |
Get the register bank for theOpIdx-th operand ofMI form the encoding constraints, if any. | |
virtual void | applyMappingImpl (MachineIRBuilder &Builder,constOperandsMapper &OpdMapper)const |
SeeapplyMapping. | |
virtual | ~RegisterBankInfo ()=default |
constRegisterBank & | getRegBank (unsignedID)const |
Get the register bank identified byID . | |
unsigned | getMaximumSize (unsigned RegBankID)const |
Get the maximum size in bits that fits in the given register bank. | |
constRegisterBank * | getRegBank (RegisterReg,constMachineRegisterInfo &MRI,constTargetRegisterInfo &TRI)const |
Get the register bank ofReg . | |
unsigned | getNumRegBanks ()const |
Get the total number of register banks. | |
virtualbool | isDivergentRegBank (constRegisterBank *RB)const |
Returns true if the register bank is considered divergent. | |
virtualconstRegisterBank & | getRegBankFromRegClass (constTargetRegisterClass &RC,LLT Ty)const |
Get a register bank that coversRC . | |
virtualunsigned | copyCost (constRegisterBank &A,constRegisterBank &B,TypeSizeSize)const |
Get the cost of a copy fromB toA , or put differently, get the cost of A = COPY B. | |
bool | cannotCopy (constRegisterBank &Dst,constRegisterBank &Src,TypeSizeSize)const |
virtualunsigned | getBreakDownCost (constValueMapping &ValMapping,constRegisterBank *CurBank=nullptr)const |
Get the cost of usingValMapping to decompose a register. | |
virtualconstInstructionMapping & | getInstrMapping (constMachineInstr &MI)const |
Get the mapping of the different operands ofMI on the register bank. | |
virtualInstructionMappings | getInstrAlternativeMappings (constMachineInstr &MI)const |
Get the alternative mappings forMI . | |
InstructionMappings | getInstrPossibleMappings (constMachineInstr &MI)const |
Get the possible mapping forMI . | |
void | applyMapping (MachineIRBuilder &Builder,constOperandsMapper &OpdMapper)const |
ApplyOpdMapper.getInstrMapping() toOpdMapper.getMI() . | |
TypeSize | getSizeInBits (RegisterReg,constMachineRegisterInfo &MRI,constTargetRegisterInfo &TRI)const |
Get the size in bits ofReg . | |
bool | verify (constTargetRegisterInfo &TRI)const |
Check that information hold by this instance make sense for the givenTRI . | |
Static Public Member Functions | |
static void | applyDefaultMapping (constOperandsMapper &OpdMapper) |
Helper method to apply something that is like the default mapping. | |
staticconstTargetRegisterClass * | constrainGenericRegister (RegisterReg,constTargetRegisterClass &RC,MachineRegisterInfo &MRI) |
Constrain the (possibly generic) virtual registerReg toRC . | |
Static Public Attributes | |
staticconstunsigned | DefaultMappingID = UINT_MAX |
Identifier used when the related instruction mapping instance is generated by target independent code. | |
staticconstunsigned | InvalidMappingID = UINT_MAX - 1 |
Identifier used when the related instruction mapping instance is generated by the default constructor. | |
Protected Member Functions | |
RegisterBankInfo (constRegisterBank **RegBanks,unsignedNumRegBanks,constunsigned *Sizes,unsignedHwMode) | |
Create aRegisterBankInfo that can accommodate up toNumRegBanks RegisterBank instances. | |
RegisterBankInfo () | |
This constructor is meaningless. | |
constRegisterBank & | getRegBank (unsignedID) |
Get the register bank identified byID . | |
constTargetRegisterClass * | getMinimalPhysRegClass (RegisterReg,constTargetRegisterInfo &TRI)const |
Get the MinimalPhysRegClass for Reg. | |
constInstructionMapping & | getInstrMappingImpl (constMachineInstr &MI)const |
Try to get the mapping ofMI . | |
constPartialMapping & | getPartialMapping (unsigned StartIdx,unsignedLength,constRegisterBank &RegBank)const |
Get the uniquely generatedPartialMapping for the given arguments. | |
Methods to get a uniquely generated ValueMapping. | |
constValueMapping & | getValueMapping (unsigned StartIdx,unsignedLength,constRegisterBank &RegBank)const |
The most commonValueMapping consists of a singlePartialMapping. | |
constValueMapping & | getValueMapping (constPartialMapping *BreakDown,unsigned NumBreakDowns)const |
Get theValueMapping for the given arguments. | |
Methods to get a uniquely generated array of ValueMapping. | |
template<typename Iterator > | |
constValueMapping * | getOperandsMapping (Iterator Begin, IteratorEnd)const |
Get the uniquely generated array ofValueMapping for the elements of betweenBegin andEnd . | |
constValueMapping * | getOperandsMapping (constSmallVectorImpl<constValueMapping * > &OpdsMapping)const |
Get the uniquely generated array ofValueMapping for the elements ofOpdsMapping . | |
constValueMapping * | getOperandsMapping (std::initializer_list<constValueMapping * > OpdsMapping)const |
Get the uniquely generated array ofValueMapping for the given arguments. | |
Protected Attributes | |
constRegisterBank ** | RegBanks |
Hold the set of supported register banks. | |
unsigned | NumRegBanks |
Total number of register banks. | |
constunsigned * | Sizes |
Hold the sizes of the register banks for all HwModes. | |
unsigned | HwMode |
Current HwMode for the target. | |
DenseMap<hash_code, std::unique_ptr<constPartialMapping > > | MapOfPartialMappings |
Keep dynamically allocatedPartialMapping in a separate map. | |
DenseMap<hash_code, std::unique_ptr<constValueMapping > > | MapOfValueMappings |
Keep dynamically allocatedValueMapping in a separate map. | |
DenseMap<hash_code, std::unique_ptr<ValueMapping[]> > | MapOfOperandsMappings |
Keep dynamically allocated array ofValueMapping in a separate map. | |
DenseMap<hash_code, std::unique_ptr<constInstructionMapping > > | MapOfInstructionMappings |
Keep dynamically allocatedInstructionMapping in a separate map. | |
DenseMap<unsigned,constTargetRegisterClass * > | PhysRegMinimalRCs |
Getting the minimal register class of a physreg is expensive. | |
Methods to get a uniquely generated InstructionMapping. | |
constInstructionMapping & | getInstructionMapping (unsignedID,unsignedCost,constValueMapping *OperandsMapping,unsigned NumOperands)const |
Method to get a uniquely generatedInstructionMapping. | |
constInstructionMapping & | getInvalidInstructionMapping ()const |
Method to get a uniquely generated invalidInstructionMapping. | |
Holds all the information related to register banks.
Definition at line40 of fileRegisterBankInfo.h.
Convenient type to represent the alternatives for mapping an instruction.
Definition at line277 of fileRegisterBankInfo.h.
| protected |
Create aRegisterBankInfo that can accommodate up toNumRegBanks
RegisterBank instances.
Definition at line56 of fileRegisterBankInfo.cpp.
Referencesassert(),End,getNumRegBanks(),Idx, andRegBanks.
| inlineprotected |
This constructor is meaningless.
It just provides a default constructor that can be used at link time when GlobalISel is not built. That way, targets can still inherit from this class without doing crazy gymnastic to avoid link time failures.
Definition at line435 of fileRegisterBankInfo.h.
Referencesllvm_unreachable.
| virtualdefault |
| static |
Helper method to apply something that is like the default mapping.
Basically, that means thatOpdMapper.getMI()
is left untouched aside from the reassignment of the register operand that have been remapped.
The type of all the new registers that have been created by the mapper are properly remapped to the type of the original registers they replace. In other words, the semantic of the instruction does not change, only the register banks.
If the mapping of one of the operand spans several registers, this method will abort as this is not like a default mapping anymore.
OpdMapper.getMI()
.getNumOperands()) the range OpdMapper.getVRegs(OpIdx) is empty or of size 1.Definition at line439 of fileRegisterBankInfo.cpp.
Referencesassert(),llvm::iterator_range< IteratorT >::begin(),llvm::dbgs(),llvm::iterator_range< IteratorT >::empty(),llvm::RegisterBankInfo::OperandsMapper::getInstrMapping(),llvm::RegisterBankInfo::OperandsMapper::getMI(),llvm::RegisterBankInfo::OperandsMapper::getMRI(),llvm::RegisterBankInfo::InstructionMapping::getNumOperands(),llvm::MachineOperand::getReg(),llvm::LLT::getSizeInBits(),llvm::RegisterBankInfo::OperandsMapper::getVRegs(),llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownLE(),llvm::MachineOperand::isReg(),llvm::LLT::isValid(),LLVM_DEBUG,MI,MRI,llvm::RegisterBankInfo::ValueMapping::NumBreakDowns,llvm::printReg(), andllvm::MachineOperand::setReg().
Referenced byapplyMapping(),llvm::AMDGPURegisterBankInfo::applyMappingBFE(),llvm::AMDGPURegisterBankInfo::applyMappingImage(),llvm::AMDGPURegisterBankInfo::applyMappingImpl(),llvm::MipsRegisterBankInfo::applyMappingImpl(),llvm::X86RegisterBankInfo::applyMappingImpl(),llvm::AMDGPURegisterBankInfo::applyMappingMAD_64_32(), andllvm::AMDGPURegisterBankInfo::applyMappingSMULU64().
| inline |
ApplyOpdMapper.getInstrMapping()
toOpdMapper.getMI()
.
After this callOpdMapper.getMI()
may not be valid anymore.OpdMapper.getInstrMapping()
.getID() carries the information of what has been chosen to mapOpdMapper.getMI()
. This ID is set by the various getInstrXXXMapping method.
Therefore, getting the mapping and applying it should be kept in sync.
Definition at line735 of fileRegisterBankInfo.h.
ReferencesapplyDefaultMapping(),applyMappingImpl(),DefaultMappingID,llvm::RegisterBankInfo::InstructionMapping::getID(), andllvm::RegisterBankInfo::OperandsMapper::getInstrMapping().
Referenced byllvm::RegBankSelect::applyMapping().
| inlinevirtual |
SeeapplyMapping.
Reimplemented inllvm::AMDGPURegisterBankInfo,llvm::MipsRegisterBankInfo, andllvm::X86RegisterBankInfo.
Definition at line576 of fileRegisterBankInfo.h.
Referencesllvm_unreachable.
Referenced byapplyMapping().
| inline |
Src
toDst
is impossible.Definition at line643 of fileRegisterBankInfo.h.
ReferencescopyCost(), andSize.
Referenced byllvm::AMDGPURegisterBankInfo::getInstrMapping(), andgetInstrMappingImpl().
| static |
Constrain the (possibly generic) virtual registerReg
toRC
.
Reg
is a virtual register that either has a bank or a class.Definition at line132 of fileRegisterBankInfo.cpp.
Referencesllvm::RegisterBank::covers(), andMRI.
Referenced byllvm::AMDGPURegisterBankInfo::buildReadFirstLane(),llvm::AMDGPURegisterBankInfo::buildVCopy(),llvm::constrainRegToClass(),copySubReg(),selectCopy(), andselectDebugInstr().
| inlinevirtual |
Get the cost of a copy fromB
toA
, or put differently, get the cost of A = COPY B.
Since register banks may cover different size,Size
specifies what will be the size in bits that will be copied around.
Reimplemented inllvm::AArch64RegisterBankInfo, andllvm::AMDGPURegisterBankInfo.
Definition at line633 of fileRegisterBankInfo.h.
Referenced bycannotCopy(),llvm::AArch64RegisterBankInfo::copyCost(),llvm::AMDGPURegisterBankInfo::copyCost(), andllvm::RegBankSelect::getRepairCost().
| inlinevirtual |
Get the cost of usingValMapping
to decompose a register.
This is similar tocopyCost, except for cases where multiple copy-like operations need to be inserted. If the register is used as a source operand and already has a bank assigned,CurBank
is non-null.
Reimplemented inllvm::AMDGPURegisterBankInfo.
Definition at line653 of fileRegisterBankInfo.h.
Referenced byllvm::RegBankSelect::getRepairCost().
| virtual |
Get the alternative mappings forMI
.
Alternative in the sense different from getInstrMapping.
Reimplemented inllvm::AArch64RegisterBankInfo,llvm::AMDGPURegisterBankInfo,llvm::PPCRegisterBankInfo, andllvm::X86RegisterBankInfo.
Definition at line434 of fileRegisterBankInfo.cpp.
Referenced byllvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(),llvm::AMDGPURegisterBankInfo::getInstrAlternativeMappings(),llvm::PPCRegisterBankInfo::getInstrAlternativeMappings(),llvm::X86RegisterBankInfo::getInstrAlternativeMappings(),llvm::AMDGPURegisterBankInfo::getInstrAlternativeMappingsIntrinsic(),llvm::AMDGPURegisterBankInfo::getInstrAlternativeMappingsIntrinsicWSideEffects(), andgetInstrPossibleMappings().
| virtual |
Get the mapping of the different operands ofMI
on the register bank.
This mapping should be the direct translation ofMI
. In other words, whenMI
is mapped with the returned mapping, only the register banks of the operands ofMI
need to be updated. In particular, neither the opcode nor the type ofMI
needs to be updated for this direct mapping.
The target independent implementation gives a mapping based on the register classes for the target specific opcode. It uses the IDRegisterBankInfo::DefaultMappingID for that mapping. Make sure you do not use that ID for the alternative mapping for MI. See getInstrAlternativeMappings for the alternative mappings.
For instance, ifMI
is a vector add, the mapping should not be a scalarization of the add.
Reimplemented inllvm::AArch64RegisterBankInfo,llvm::AMDGPURegisterBankInfo,llvm::ARMRegisterBankInfo,llvm::M68kRegisterBankInfo,llvm::MipsRegisterBankInfo,llvm::PPCRegisterBankInfo,llvm::RISCVRegisterBankInfo, andllvm::X86RegisterBankInfo.
Definition at line407 of fileRegisterBankInfo.cpp.
ReferencesgetInstrMappingImpl(),llvm::RegisterBankInfo::InstructionMapping::isValid(),llvm_unreachable, andMI.
Referenced byllvm::RegBankSelect::assignInstr(),llvm::RegisterBankInfo::OperandsMapper::createVRegs(),getInstrPossibleMappings(),llvm::RegisterBankInfo::OperandsMapper::getVRegs(),llvm::RegisterBankInfo::OperandsMapper::print(), andllvm::RegisterBankInfo::OperandsMapper::setVRegs().
| protected |
Try to get the mapping ofMI
.
See getInstrMapping for more details on what a mapping represents.
Unlike getInstrMapping the returnedInstructionMapping may be invalid (isValid() == false). This means that the target independent code is not smart enough to get the mapping ofMI
and thus, the target has to provide the information forMI
.
This implementation is able to get the mapping of:
Definition at line162 of fileRegisterBankInfo.cpp.
Referencesassert(),cannotCopy(),DefaultMappingID,llvm::TargetSubtargetInfo::getInstrInfo(),getInstructionMapping(),getInvalidInstructionMapping(),getOperandsMapping(),llvm::MachineOperand::getReg(),getRegBank(),getRegBankFromConstraints(),llvm::MachineFunction::getRegInfo(),llvm::TargetSubtargetInfo::getRegisterInfo(),getSizeInBits(),llvm::MachineFunction::getSubtarget(),getValueMapping(),isCopyLike(),llvm::MachineOperand::isReg(),MI,MRI,Size,TII, andTRI.
Referenced bygetInstrMapping(),llvm::AArch64RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMapping(),llvm::ARMRegisterBankInfo::getInstrMapping(),llvm::M68kRegisterBankInfo::getInstrMapping(),llvm::MipsRegisterBankInfo::getInstrMapping(),llvm::PPCRegisterBankInfo::getInstrMapping(),llvm::RISCVRegisterBankInfo::getInstrMapping(), andllvm::X86RegisterBankInfo::getInstrMapping().
RegisterBankInfo::InstructionMappings RegisterBankInfo::getInstrPossibleMappings | ( | constMachineInstr & | MI | ) | const |
Get the possible mapping forMI
.
A mapping defines where the different operands may live and at what cost. For instance, let us consider: v0(16) = G_ADD <2 x i8> v1, v2 The possible mapping could be:
{/*ID*/VectorAdd, /*Cost*/1, /*v0*/{(0xFFFF, VPR)}, /*v1*/{(0xFFFF, VPR)}, /*v2*/{(0xFFFF, VPR)}} {/*ID*/ScalarAddx2, /*Cost*/2, /*v0*/{(0x00FF, GPR),(0xFF00, GPR)}, /*v1*/{(0x00FF, GPR),(0xFF00, GPR)}, /*v2*/{(0x00FF, GPR),(0xFF00, GPR)}}
MI
current form.Definition at line415 of fileRegisterBankInfo.cpp.
Referencesllvm::append_range(),assert(),getInstrAlternativeMappings(),getInstrMapping(),MI, andllvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced byllvm::RegBankSelect::assignInstr().
| inline |
Method to get a uniquely generatedInstructionMapping.
Definition at line534 of fileRegisterBankInfo.h.
Referenced byllvm::AMDGPURegisterBankInfo::addMappingFromTable(),llvm::AMDGPURegisterBankInfo::getDefaultMappingAllVGPR(),llvm::AMDGPURegisterBankInfo::getDefaultMappingSOP(),llvm::AMDGPURegisterBankInfo::getDefaultMappingVOP(),llvm::AMDGPURegisterBankInfo::getImageMapping(),llvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(),llvm::AMDGPURegisterBankInfo::getInstrAlternativeMappings(),llvm::X86RegisterBankInfo::getInstrAlternativeMappings(),llvm::AArch64RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMapping(),llvm::ARMRegisterBankInfo::getInstrMapping(),llvm::M68kRegisterBankInfo::getInstrMapping(),llvm::MipsRegisterBankInfo::getInstrMapping(),llvm::PPCRegisterBankInfo::getInstrMapping(),llvm::RISCVRegisterBankInfo::getInstrMapping(),llvm::X86RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMappingForLoad(), andgetInstrMappingImpl().
| inline |
Method to get a uniquely generated invalidInstructionMapping.
Definition at line542 of fileRegisterBankInfo.h.
Referenced byllvm::AArch64RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMapping(),llvm::ARMRegisterBankInfo::getInstrMapping(),llvm::M68kRegisterBankInfo::getInstrMapping(),llvm::MipsRegisterBankInfo::getInstrMapping(),llvm::PPCRegisterBankInfo::getInstrMapping(),llvm::X86RegisterBankInfo::getInstrMapping(), andgetInstrMappingImpl().
Get the maximum size in bits that fits in the given register bank.
Definition at line590 of fileRegisterBankInfo.h.
ReferencesHwMode,NumRegBanks, andSizes.
Referenced byllvm::AArch64RegisterBankInfo::AArch64RegisterBankInfo(),llvm::ARMRegisterBankInfo::ARMRegisterBankInfo(),llvm::RISCVRegisterBankInfo::getInstrMapping(),llvm::RegisterBankInfo::PartialMapping::verify(),llvm::RegisterBank::verify(), andllvm::X86RegisterBankInfo::X86RegisterBankInfo().
| protected |
Get the MinimalPhysRegClass for Reg.
Definition at line103 of fileRegisterBankInfo.cpp.
Referencesassert(),PhysRegMinimalRCs, andTRI.
Referenced bygetRegBank(), andgetSizeInBits().
| inline |
Get the total number of register banks.
Definition at line603 of fileRegisterBankInfo.h.
ReferencesNumRegBanks.
Referenced bygetRegBank(),RegisterBankInfo(), andverify().
| protected |
Get the uniquely generated array ofValueMapping for the elements ofOpdsMapping
.
Elements ofOpdsMapping
that are nullptr will be replaced by invalidValueMapping (ValueMapping::isValid == false).
Definition at line362 of fileRegisterBankInfo.cpp.
Referencesllvm::SmallVectorTemplateCommon< T, typename >::begin(),llvm::SmallVectorTemplateCommon< T, typename >::end(), andgetOperandsMapping().
| protected |
Get the uniquely generated array ofValueMapping for the elements of betweenBegin
andEnd
.
Elements that are nullptr will be replaced by invalidValueMapping (ValueMapping::isValid == false).
Begin
andEnd
must uniquely identify aValueMapping. Otherwise, there is no guarantee that the return instance will be unique, i.e., another OperandsMapping could have the same content.Definition at line333 of fileRegisterBankInfo.cpp.
ReferencesEnd,llvm::hash_combine_range(),Idx, andMapOfOperandsMappings.
Referenced byllvm::AMDGPURegisterBankInfo::addMappingFromTable(),llvm::AMDGPURegisterBankInfo::getDefaultMappingAllVGPR(),llvm::AMDGPURegisterBankInfo::getDefaultMappingSOP(),llvm::AMDGPURegisterBankInfo::getDefaultMappingVOP(),llvm::AMDGPURegisterBankInfo::getImageMapping(),llvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(),llvm::AMDGPURegisterBankInfo::getInstrAlternativeMappings(),llvm::X86RegisterBankInfo::getInstrAlternativeMappings(),llvm::AArch64RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMapping(),llvm::ARMRegisterBankInfo::getInstrMapping(),llvm::M68kRegisterBankInfo::getInstrMapping(),llvm::MipsRegisterBankInfo::getInstrMapping(),llvm::PPCRegisterBankInfo::getInstrMapping(),llvm::RISCVRegisterBankInfo::getInstrMapping(),llvm::X86RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMappingForLoad(),getInstrMappingImpl(), andgetOperandsMapping().
| protected |
Get the uniquely generated array ofValueMapping for the given arguments.
Arguments that are nullptr will be replaced by invalidValueMapping (ValueMapping::isValid == false).
| protected |
Get the uniquely generatedPartialMapping for the given arguments.
Definition at line281 of fileRegisterBankInfo.cpp.
ReferenceshashPartialMapping(),llvm::Length, andMapOfPartialMappings.
Referenced bygetValueMapping().
constRegisterBank * RegisterBankInfo::getRegBank | ( | Register | Reg, |
constMachineRegisterInfo & | MRI, | ||
constTargetRegisterInfo & | TRI | ||
) | const |
Get the register bank ofReg
.
If Reg has not been assigned a register, a register class, or a register bank, then this returns nullptr.
Definition at line84 of fileRegisterBankInfo.cpp.
ReferencesgetMinimalPhysRegClass(),getRegBankFromRegClass(),MRI, andTRI.
| inlineprotected |
Get the register bank identified byID
.
Definition at line440 of fileRegisterBankInfo.h.
Referencesassert(),getNumRegBanks(), andRegBanks.
Referenced byllvm::AArch64RegisterBankInfo::AArch64RegisterBankInfo(),llvm::AMDGPURegisterBankInfo::AMDGPURegisterBankInfo(),llvm::AMDGPURegisterBankInfo::applyMappingDynStackAlloc(),llvm::AMDGPURegisterBankInfo::applyMappingImpl(),llvm::ARMRegisterBankInfo::ARMRegisterBankInfo(),llvm::RegBankSelect::assignInstr(),llvm::RegBankSelect::assignmentMatch(),buildReadAnyLane(),llvm::AMDGPURegisterBankInfo::buildReadFirstLane(),llvm::AMDGPURegisterBankInfo::collectWaterfallOperands(),llvm::AMDGPURegisterBankInfo::constrainOpWithReadfirstlane(),llvm::AMDGPURegisterBankInfo::executeInWaterfallLoop(),llvm::GIMatchTableExecutor::executeMatchTable(),llvm::AArch64RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMapping(),llvm::RISCVRegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMappingForLoad(),getInstrMappingImpl(),llvm::SIInstrInfo::getInstructionUniformity(),llvm::AMDGPURegisterBankInfo::getMappingType(),llvm::CombinerHelper::getRegBank(),getRegBank(),llvm::AArch64RegisterBankInfo::getRegBankFromRegClass(),llvm::PPCRegisterBankInfo::getRegBankFromRegClass(),llvm::AMDGPURegisterBankInfo::getRegBankID(),getRegClassesForCopy(),llvm::RegBankSelect::getRepairCost(),llvm::AMDGPURegisterBankInfo::getValueMappingForPtr(),llvm::AMDGPURegisterBankInfo::isSALUMapping(),llvm::SIRegisterInfo::isUniformReg(),selectCopy(),selectMergeValues(),selectUnmergeValues(),llvm::AMDGPURegisterBankInfo::setBufferOffsets(),llvm::MipsRegisterBankInfo::setRegBank(),llvm::AMDGPURegisterBankInfo::split64BitValueForMapping(),unmergeReadAnyLane(),unsupportedBinOp(),verify(), andllvm::X86RegisterBankInfo::X86RegisterBankInfo().
| inline |
Get the register bank identified byID
.
Definition at line585 of fileRegisterBankInfo.h.
ReferencesgetRegBank().
constRegisterBank * RegisterBankInfo::getRegBankFromConstraints | ( | constMachineInstr & | MI, |
unsigned | OpIdx, | ||
constTargetInstrInfo & | TII, | ||
constMachineRegisterInfo & | MRI | ||
) | const |
Get the register bank for theOpIdx-th
operand ofMI
form the encoding constraints, if any.
MI
did not provide enough information to deduce it.Definition at line112 of fileRegisterBankInfo.cpp.
Referencesassert(),llvm::RegisterBank::covers(),getRegBankFromRegClass(),MI,MRI,TII, andTRI.
Referenced bygetInstrMappingImpl().
| inlinevirtual |
Get a register bank that coversRC
.
RC
is a user-defined register class (as opposed as one generated byTableGen).Reimplemented inllvm::AArch64RegisterBankInfo,llvm::PPCRegisterBankInfo,llvm::SPIRVRegisterBankInfo, andllvm::AMDGPURegisterBankInfo.
Definition at line623 of fileRegisterBankInfo.h.
Referencesllvm_unreachable.
Referenced byllvm::GIMatchTableExecutor::executeMatchTable(),getRegBank(),getRegBankFromConstraints(),llvm::AArch64RegisterBankInfo::getRegBankFromRegClass(), andllvm::PPCRegisterBankInfo::getRegBankFromRegClass().
TypeSize RegisterBankInfo::getSizeInBits | ( | Register | Reg, |
constMachineRegisterInfo & | MRI, | ||
constTargetRegisterInfo & | TRI | ||
) | const |
Get the size in bits ofReg
.
Utility method to get the size of any registers. Unlike MachineRegisterInfo::getSize, the register does not need to be a virtual register.
Reg
!= 0 (NoRegister).Definition at line498 of fileRegisterBankInfo.cpp.
Referencesassert(),getMinimalPhysRegClass(),MRI, andTRI.
Referenced byllvm::AMDGPURegisterBankInfo::addMappingFromTable(),llvm::AMDGPURegisterBankInfo::getAGPROpMapping(),llvm::AMDGPURegisterBankInfo::getDefaultMappingAllVGPR(),llvm::AMDGPURegisterBankInfo::getDefaultMappingSOP(),llvm::AMDGPURegisterBankInfo::getDefaultMappingVOP(),llvm::AMDGPURegisterBankInfo::getImageMapping(),llvm::AArch64RegisterBankInfo::getInstrAlternativeMappings(),llvm::AMDGPURegisterBankInfo::getInstrAlternativeMappings(),llvm::X86RegisterBankInfo::getInstrAlternativeMappings(),llvm::AArch64RegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMapping(),llvm::MipsRegisterBankInfo::getInstrMapping(),llvm::PPCRegisterBankInfo::getInstrMapping(),llvm::AMDGPURegisterBankInfo::getInstrMappingForLoad(),getInstrMappingImpl(),getRegClassesForCopy(),llvm::RegBankSelect::getRepairCost(),llvm::AMDGPURegisterBankInfo::getSGPROpMapping(),llvm::AMDGPURegisterBankInfo::getVGPROpMapping(),selectCopy(), andllvm::RegisterBankInfo::InstructionMapping::verify().
| protected |
Get theValueMapping for the given arguments.
Definition at line315 of fileRegisterBankInfo.cpp.
ReferenceshashValueMapping(), andMapOfValueMappings.
| protected |
The most commonValueMapping consists of a singlePartialMapping.
Feature a method for that.
Definition at line298 of fileRegisterBankInfo.cpp.
ReferencesgetPartialMapping(),getValueMapping(), andllvm::Length.
Referenced byllvm::AMDGPURegisterBankInfo::getInstrMapping(),getInstrMappingImpl(), andgetValueMapping().
| inlinevirtual |
Returns true if the register bank is considered divergent.
Reimplemented inllvm::AMDGPURegisterBankInfo.
Definition at line606 of fileRegisterBankInfo.h.
Referenced byllvm::SIRegisterInfo::isUniformReg().
bool RegisterBankInfo::verify | ( | constTargetRegisterInfo & | TRI | ) | const |
Check that information hold by this instance make sense for the givenTRI
.
Definition at line70 of fileRegisterBankInfo.cpp.
Referencesassert(),llvm::dbgs(),End,llvm::RegisterBank::getID(),getNumRegBanks(),getRegBank(),Idx,LLVM_DEBUG,TRI, andllvm::RegisterBank::verify().
Identifier used when the related instruction mapping instance is generated by target independent code.
Make sure not to use that identifier to avoid possible collision.
Definition at line672 of fileRegisterBankInfo.h.
Referenced byapplyMapping(),llvm::AArch64RegisterBankInfo::getInstrMapping(),llvm::ARMRegisterBankInfo::getInstrMapping(),llvm::M68kRegisterBankInfo::getInstrMapping(),llvm::MipsRegisterBankInfo::getInstrMapping(),llvm::PPCRegisterBankInfo::getInstrMapping(),llvm::RISCVRegisterBankInfo::getInstrMapping(),llvm::X86RegisterBankInfo::getInstrMapping(), andgetInstrMappingImpl().
| protected |
Current HwMode for the target.
Definition at line398 of fileRegisterBankInfo.h.
Referenced bygetMaximumSize().
Identifier used when the related instruction mapping instance is generated by the default constructor.
Make sure not to use that identifier.
Definition at line677 of fileRegisterBankInfo.h.
Referenced byllvm::RegisterBankInfo::InstructionMapping::isValid().
| mutableprotected |
Keep dynamically allocatedInstructionMapping in a separate map.
This shouldn't be needed when everything getsTableGen'ed.
Definition at line418 of fileRegisterBankInfo.h.
| mutableprotected |
Keep dynamically allocated array ofValueMapping in a separate map.
This shouldn't be needed when everything getsTableGen'ed.
Definition at line413 of fileRegisterBankInfo.h.
Referenced bygetOperandsMapping().
| mutableprotected |
Keep dynamically allocatedPartialMapping in a separate map.
This shouldn't be needed when everything getsTableGen'ed.
Definition at line403 of fileRegisterBankInfo.h.
Referenced bygetPartialMapping().
| mutableprotected |
Keep dynamically allocatedValueMapping in a separate map.
This shouldn't be needed when everything getsTableGen'ed.
Definition at line408 of fileRegisterBankInfo.h.
Referenced bygetValueMapping().
| protected |
Total number of register banks.
Definition at line392 of fileRegisterBankInfo.h.
Referenced bygetMaximumSize(), andgetNumRegBanks().
| mutableprotected |
Getting the minimal register class of a physreg is expensive.
Cache this information as we get it.
Definition at line422 of fileRegisterBankInfo.h.
Referenced bygetMinimalPhysRegClass().
| protected |
Hold the set of supported register banks.
Definition at line389 of fileRegisterBankInfo.h.
Referenced bygetRegBank(), andRegisterBankInfo().
Hold the sizes of the register banks for all HwModes.
Definition at line395 of fileRegisterBankInfo.h.
Referenced byllvm::AMDGPURegisterBankInfo::addMappingFromTable(), andgetMaximumSize().