LLVM
8.0.1
|
Helper struct that represents how a value is mapped through different register banks. More...
#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
Public Member Functions | |
ValueMapping () | |
The default constructor creates an invalid (isValid() == false) instance. More... | |
ValueMapping (const PartialMapping *BreakDown, unsigned NumBreakDowns) | |
Initialize a ValueMapping with the given parameter. More... | |
const PartialMapping * | begin () const |
Iterators through the PartialMappings. More... | |
const PartialMapping * | end () const |
bool | isValid () const |
Check if this ValueMapping is valid. More... | |
bool | verify (unsigned MeaningfulBitWidth) const |
Verify that this mapping makes sense for a value of MeaningfulBitWidth . More... | |
void | dump () const |
Print this on dbgs() stream. More... | |
void | print (raw_ostream &OS) const |
Print this on OS ;. More... | |
Public Attributes | |
const PartialMapping * | BreakDown |
How the value is broken down between the different register banks. More... | |
unsigned | NumBreakDowns |
Number of partial mapping to break down this value. More... | |
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 143 of file RegisterBankInfo.h.
|
inline |
The default constructor creates an invalid (isValid() == false) instance.
Definition at line 152 of file RegisterBankInfo.h.
|
inline |
Initialize a ValueMapping with the given parameter.
BreakDown
needs to have a life time at least as long as this instance.
Definition at line 157 of file RegisterBankInfo.h.
|
inline |
Iterators through the PartialMappings.
Definition at line 161 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::OperandsMapper::createVRegs().
LLVM_DUMP_METHOD void RegisterBankInfo::ValueMapping::dump | ( | ) | const |
Print this on dbgs() stream.
Definition at line 531 of file RegisterBankInfo.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 162 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::OperandsMapper::createVRegs().
|
inline |
Check if this ValueMapping is valid.
Definition at line 165 of file RegisterBankInfo.h.
References llvm::RegisterBankInfo::PartialMapping::dump(), llvm::RegisterBankInfo::PartialMapping::print(), and llvm::RegisterBankInfo::PartialMapping::verify().
void RegisterBankInfo::ValueMapping::print | ( | raw_ostream & | OS | ) | const |
Print this on OS
;.
Definition at line 537 of file RegisterBankInfo.cpp.
Verify that this mapping makes sense for a value of MeaningfulBitWidth
.
Definition at line 501 of file RegisterBankInfo.cpp.
References assert(), llvm::APInt::getBitsSet(), llvm::RegisterBankInfo::PartialMapping::getHighBitIdx(), llvm::APInt::isAllOnesValue(), llvm::max(), 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 145 of file RegisterBankInfo.h.
Referenced by llvm::ARM::checkValueMapping(), and llvm::RegBankSelect::getAnalysisUsage().
unsigned llvm::RegisterBankInfo::ValueMapping::NumBreakDowns |
Number of partial mapping to break down this value.
Definition at line 148 of file RegisterBankInfo.h.
Referenced by llvm::RegisterBankInfo::applyDefaultMapping(), llvm::ARM::checkValueMapping(), llvm::RegBankSelect::getAnalysisUsage(), llvm::RegisterBankInfo::OperandsMapper::getVRegs(), and llvm::RegisterBankInfo::OperandsMapper::OperandsMapper().