16 #define DEBUG_TYPE "registerbank"
20 const unsigned RegisterBank::InvalidID = UINT_MAX;
24 const uint32_t *CoveredClasses,
unsigned NumRegClasses)
25 : ID(ID), Name(Name), Size(Size) {
26 ContainedRegClasses.
resize(NumRegClasses);
43 for (
unsigned SubRCId = 0; SubRCId !=
End; ++SubRCId) {
52 "Size is not big enough for all the subclasses!");
53 assert(
covers(SubRC) &&
"Not all subclasses are covered");
61 return ContainedRegClasses.
test(RC.
getID());
65 return ID != InvalidID && Name !=
nullptr && Size != 0 &&
67 !ContainedRegClasses.
empty();
75 "ID does not uniquely identify a RegisterBank");
76 return &OtherRB ==
this;
79 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
90 OS <<
"(ID:" <<
getID() <<
", Size:" <<
getSize() <<
")\n"
91 <<
"isValid:" <<
isValid() <<
'\n'
92 <<
"Number of Covered register classes: " << ContainedRegClasses.
count()
96 if (!TRI || ContainedRegClasses.
empty())
99 "TRI does not match the initialization process?");
101 OS <<
"Covered register classes:\n";
void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
size_type size() const
size - Returns the number of bits in this bitvector.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
void dump(const TargetRegisterInfo *TRI=nullptr) const
Dump the register mask on dbgs() stream.
bool hasSubClassEq(const TargetRegisterClass *RC) const
Returns true if RC is a sub-class of or equal to this class.
unsigned getRegSizeInBits(const TargetRegisterClass &RC) const
Return the size in bits of a register from class RC.
unsigned getID() const
Return the register class ID number.
bool verify(const TargetRegisterInfo &TRI) const
Check if this register bank is valid.
unsigned getNumRegClasses() const
const TargetRegisterClass * getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
const char * getRegClassName(const TargetRegisterClass *Class) const
Returns the name of the register class.
size_type count() const
count - Returns the number of bits which are set.
unsigned getID() const
Get the identifier of this register bank.
bool empty() const
empty - Tests whether there are no bits in this bitvector.
static const unsigned End
void print(raw_ostream &OS, bool IsForDebug=false, const TargetRegisterInfo *TRI=nullptr) const
Print the register mask on OS.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool isValid() const
Check whether this instance is ready to be used.
const char * getName() const
Get a user friendly name of this register bank.
bool test(unsigned Idx) const
RegisterBank(unsigned ID, const char *Name, unsigned Size, const uint32_t *ContainedRegClasses, unsigned NumRegClasses)
This class implements the register bank concept.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
unsigned getSize() const
Get the maximal size in bits that fits in this register bank.
bool covers(const TargetRegisterClass &RC) const
Check whether this register bank covers RC.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This class implements an extremely fast bulk output stream that can only output to a stream...
void setBitsInMask(const uint32_t *Mask, unsigned MaskWords=~0u)
setBitsInMask - Add '1' bits from Mask to this vector.
bool operator==(const RegisterBank &OtherRB) const
Check whether OtherRB is the same as this.