LLVM
8.0.1
|
This class implements the register bank concept. More...
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
Public Member Functions | |
RegisterBank (unsigned ID, const char *Name, unsigned Size, const uint32_t *CoveredClasses, unsigned NumRegClasses) | |
unsigned | getID () const |
Get the identifier of this register bank. More... | |
const char * | getName () const |
Get a user friendly name of this register bank. More... | |
unsigned | getSize () const |
Get the maximal size in bits that fits in this register bank. More... | |
bool | isValid () const |
Check whether this instance is ready to be used. More... | |
bool | verify (const TargetRegisterInfo &TRI) const |
Check if this register bank is valid. More... | |
bool | covers (const TargetRegisterClass &RC) const |
Check whether this register bank covers RC . More... | |
bool | operator== (const RegisterBank &OtherRB) const |
Check whether OtherRB is the same as this. More... | |
bool | operator!= (const RegisterBank &OtherRB) const |
void | dump (const TargetRegisterInfo *TRI=nullptr) const |
Dump the register mask on dbgs() stream. More... | |
void | print (raw_ostream &OS, bool IsForDebug=false, const TargetRegisterInfo *TRI=nullptr) const |
Print the register mask on OS. More... | |
This class implements the register bank concept.
Two instances of RegisterBank must have different ID. This property is enforced by the RegisterBankInfo class.
Definition at line 29 of file RegisterBank.h.
RegisterBank::RegisterBank | ( | unsigned | ID, |
const char * | Name, | ||
unsigned | Size, | ||
const uint32_t * | CoveredClasses, | ||
unsigned | NumRegClasses | ||
) |
Definition at line 23 of file RegisterBank.cpp.
References llvm::BitVector::resize(), and llvm::BitVector::setBitsInMask().
bool RegisterBank::covers | ( | const TargetRegisterClass & | RC | ) | const |
Check whether this register bank covers RC
.
In other words, check if this register bank fully covers the registers that RC
contains.
Definition at line 60 of file RegisterBank.cpp.
References assert(), llvm::TargetRegisterClass::getID(), isValid(), and llvm::BitVector::test().
Referenced by llvm::AArch64RegisterBankInfo::AArch64RegisterBankInfo(), llvm::ARMRegisterBankInfo::ARMRegisterBankInfo(), llvm::RegisterBankInfo::constrainGenericRegister(), llvm::RegisterBankInfo::getRegBankFromConstraints(), getSize(), and llvm::X86RegisterBankInfo::X86RegisterBankInfo().
LLVM_DUMP_METHOD void RegisterBank::dump | ( | const TargetRegisterInfo * | TRI = nullptr | ) | const |
Dump the register mask on dbgs() stream.
The dump is verbose.
Definition at line 81 of file RegisterBank.cpp.
References llvm::dbgs(), and print().
Referenced by operator!=().
|
inline |
Get the identifier of this register bank.
Definition at line 48 of file RegisterBank.h.
Referenced by buildEXP(), canTurnIntoCOPY(), changeFCMPPredToAArch64CC(), llvm::AMDGPURegisterBankInfo::copyCost(), llvm::SIRegisterInfo::getConstrainedRegClassForOperand(), llvm::AArch64RegisterBankInfo::getInstrMapping(), getRegClassFromGRPhysReg(), hashPartialMapping(), isConstant(), isInstrUniform(), operator==(), print(), selectCopy(), selectMergeValues(), and selectUnmergeValues().
Get a user friendly name of this register bank.
Should be used only for debugging purposes.
Definition at line 52 of file RegisterBank.h.
Referenced by matchPair(), print(), and llvm::printRegClassOrBank().
|
inline |
Get the maximal size in bits that fits in this register bank.
Definition at line 55 of file RegisterBank.h.
References covers(), isValid(), operator==(), TRI, and verify().
Referenced by llvm::AArch64RegisterBankInfo::AArch64RegisterBankInfo(), llvm::ARMRegisterBankInfo::ARMRegisterBankInfo(), matchPair(), print(), and llvm::X86RegisterBankInfo::X86RegisterBankInfo().
bool RegisterBank::isValid | ( | ) | const |
Check whether this instance is ready to be used.
Definition at line 65 of file RegisterBank.cpp.
References llvm::BitVector::empty().
|
inline |
Definition at line 76 of file RegisterBank.h.
References dump(), operator==(), and print().
bool RegisterBank::operator== | ( | const RegisterBank & | OtherRB | ) | const |
Check whether OtherRB
is the same as this.
Definition at line 71 of file RegisterBank.cpp.
References assert(), and getID().
Referenced by getSize(), and operator!=().
void RegisterBank::print | ( | raw_ostream & | OS, |
bool | IsForDebug = false , |
||
const TargetRegisterInfo * | TRI = nullptr |
||
) | const |
Print the register mask on OS.
If IsForDebug is false, then only the name of the register bank is printed. Otherwise, all the fields are printing. TRI is then used to print the name of the register classes that this register bank covers.
Definition at line 86 of file RegisterBank.cpp.
References assert(), llvm::BitVector::count(), llvm::BitVector::empty(), getID(), getName(), llvm::TargetRegisterInfo::getNumRegClasses(), getSize(), isValid(), and llvm::BitVector::size().
Referenced by dump(), operator!=(), and llvm::operator<<().
bool RegisterBank::verify | ( | const TargetRegisterInfo & | TRI | ) | const |
Check if this register bank is valid.
In other words, if it has been properly constructed.
Definition at line 31 of file RegisterBank.cpp.
References assert(), and isValid().
Referenced by getSize().