16 #define DEBUG_TYPE "registerbank"
20 const unsigned RegisterBank::InvalidID = UINT_MAX;
24 : ID(ID), Name(Name), Size(Size) {
25 ContainedRegClasses.
resize(200);
42 for (
unsigned SubRCId = 0; SubRCId !=
End; ++SubRCId) {
51 "Size is not big enough for all the subclasses!");
52 assert(
covers(SubRC) &&
"Not all subclasses are covered");
60 return ContainedRegClasses.
test(RC.
getID());
64 return ID != InvalidID &&
Name !=
nullptr && Size != 0 &&
66 !ContainedRegClasses.
empty();
74 "ID does not uniquely identify a RegisterBank");
75 return &OtherRB ==
this;
87 OS <<
"(ID:" <<
getID() <<
", Size:" <<
getSize() <<
")\n"
88 <<
"isValid:" <<
isValid() <<
'\n'
89 <<
"Number of Covered register classes: " << ContainedRegClasses.
count()
93 if (!TRI || ContainedRegClasses.
empty())
96 "TRI does not match the initialization process?");
98 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 getID() const
Return the register class ID number.
bool verify(const TargetRegisterInfo &TRI) const
Check if this register bank is valid.
RegisterBank(unsigned ID, const char *Name, unsigned Size, const uint32_t *ContainedRegClasses)
unsigned getSize() const
Return the size of the register in bytes, which is also the size of a stack slot allocated to hold a ...
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
This class implements the register bank concept.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
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.