LLVM 20.0.0git
|
Helper struct that represents how a value is mapped through different register banks. More...
#include "llvm/CodeGen/RegisterBankInfo.h"
Public Member Functions | |
ValueMapping () | |
The default constructor creates an invalid (isValid() == false) instance. | |
constexpr | ValueMapping (const PartialMapping *BreakDown, unsigned NumBreakDowns) |
Initialize a ValueMapping with the given parameter. | |
const PartialMapping * | begin () const |
Iterators through the PartialMappings. | |
const PartialMapping * | end () const |
bool | partsAllUniform () const |
bool | isValid () const |
Check if this ValueMapping is valid. | |
bool | verify (const RegisterBankInfo &RBI, TypeSize MeaningfulBitWidth) const |
Verify that this mapping makes sense for a value of MeaningfulBitWidth . | |
void | dump () const |
Print this on dbgs() stream. | |
void | print (raw_ostream &OS) const |
Print this on OS ;. | |
Public Attributes | |
const PartialMapping * | BreakDown |
How the value is broken down between the different register banks. | |
unsigned | NumBreakDowns |
Number of partial mapping to break down this value. | |
Helper struct that represents how a value is mapped through different register banks.
E.g., Let say we have a 32-bit add and a <2 x 32-bit> vadd. We can expand the <2 x 32-bit> add into 2 x 32-bit add.
Currently the TableGen-like file would look like:
With the array of pointer, we would have:
Given that a PartialMapping is actually small, the code size impact is actually a degradation. Moreover the compile time will be hit by the additional indirection. If PartialMapping gets bigger we may reconsider.
Definition at line 146 of file RegisterBankInfo.h.
|
inline |
The default constructor creates an invalid (isValid() == false) instance.
Definition at line 155 of file RegisterBankInfo.h.
|
inlineconstexpr |
Initialize a ValueMapping with the given parameter.
BreakDown
needs to have a life time at least as long as this instance.
Definition at line 160 of file RegisterBankInfo.h.
|
inline |
Iterators through the PartialMappings.
Definition at line 165 of file RegisterBankInfo.h.
References BreakDown.
Referenced by llvm::RegisterBankInfo::OperandsMapper::createVRegs().
LLVM_DUMP_METHOD void RegisterBankInfo::ValueMapping::dump | ( | ) | const |
Print this on dbgs() stream.
Definition at line 587 of file RegisterBankInfo.cpp.
References llvm::dbgs(), and llvm::print().
|
inline |
Definition at line 166 of file RegisterBankInfo.h.
References BreakDown, and NumBreakDowns.
Referenced by llvm::RegisterBankInfo::OperandsMapper::createVRegs().
|
inline |
Check if this ValueMapping is valid.
Definition at line 173 of file RegisterBankInfo.h.
References BreakDown, and NumBreakDowns.
bool RegisterBankInfo::ValueMapping::partsAllUniform | ( | ) | const |
Definition at line 542 of file RegisterBankInfo.cpp.
References llvm::First.
Referenced by llvm::RegBankSelect::repairReg().
void RegisterBankInfo::ValueMapping::print | ( | raw_ostream & | OS | ) | const |
Print this on OS
;.
Definition at line 593 of file RegisterBankInfo.cpp.
References OS.
Referenced by llvm::operator<<().
bool RegisterBankInfo::ValueMapping::verify | ( | const RegisterBankInfo & | RBI, |
TypeSize | MeaningfulBitWidth | ||
) | const |
Verify that this mapping makes sense for a value of MeaningfulBitWidth
.
Definition at line 555 of file RegisterBankInfo.cpp.
References assert(), llvm::APInt::getBitsSet(), llvm::RegisterBankInfo::PartialMapping::getHighBitIdx(), llvm::APInt::isAllOnes(), llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::isScalable(), llvm::RegisterBankInfo::PartialMapping::StartIdx, and llvm::RegisterBankInfo::PartialMapping::verify().
Referenced by llvm::RegisterBankInfo::InstructionMapping::verify().
const PartialMapping* llvm::RegisterBankInfo::ValueMapping::BreakDown |
How the value is broken down between the different register banks.
Definition at line 148 of file RegisterBankInfo.h.
Referenced by llvm::RegBankSelect::applyMapping(), llvm::AMDGPURegisterBankInfo::applyMappingBFE(), llvm::AMDGPURegisterBankInfo::applyMappingImpl(), llvm::AMDGPURegisterBankInfo::applyMappingLoad(), llvm::AMDGPURegisterBankInfo::applyMappingSBufferLoad(), llvm::RegBankSelect::assignmentMatch(), begin(), llvm::ARM::checkValueMapping(), end(), llvm::AMDGPURegisterBankInfo::getBreakDownCost(), llvm::RegBankSelect::getRepairCost(), isValid(), and llvm::RegBankSelect::repairReg().
unsigned llvm::RegisterBankInfo::ValueMapping::NumBreakDowns |
Number of partial mapping to break down this value.
Definition at line 151 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping(), llvm::RegBankSelect::applyMapping(), llvm::RegBankSelect::assignmentMatch(), llvm::ARM::checkValueMapping(), end(), llvm::AMDGPURegisterBankInfo::getBreakDownCost(), llvm::RegBankSelect::getRepairCost(), llvm::RegisterBankInfo::OperandsMapper::getVRegs(), isValid(), llvm::RegBankSelect::repairReg(), and llvm::RegBankSelect::tryAvoidingSplit().