16#include "llvm/Config/llvm-config.h"
19#define DEBUG_TYPE "registerbank"
25 for (
unsigned RCId = 0,
End =
TRI.getNumRegClasses(); RCId !=
End; ++RCId) {
36 for (
unsigned SubRCId = 0; SubRCId !=
End; ++SubRCId) {
45 "Size is not big enough for all the subclasses!");
46 assert(
covers(SubRC) &&
"Not all subclasses are covered");
53 return (CoveredClasses[RC.
getID() / 32] & (1U << RC.
getID() % 32)) != 0;
61 "ID does not uniquely identify a RegisterBank");
62 return &OtherRB ==
this;
65#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
78 for (
int i = 0, e = ((NumRegClasses + 31) / 32); i != e; ++i)
81 OS <<
"(ID:" <<
getID() <<
")\n"
82 <<
"Number of Covered register classes: " << Count <<
'\n';
85 if (!
TRI || NumRegClasses == 0)
87 assert(NumRegClasses ==
TRI->getNumRegClasses() &&
88 "TRI does not match the initialization process?");
89 OS <<
"Covered register classes:\n";
91 for (
unsigned RCId = 0,
End =
TRI->getNumRegClasses(); RCId !=
End; ++RCId) {
95 OS << LS <<
TRI->getRegClassName(&RC);
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
unsigned const TargetRegisterInfo * TRI
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Holds all the information related to register banks.
unsigned getMaximumSize(unsigned RegBankID) const
Get the maximum size in bits that fits in the given register bank.
This class implements the register bank concept.
bool verify(const RegisterBankInfo &RBI, const TargetRegisterInfo &TRI) const
Check if this register bank is valid.
void print(raw_ostream &OS, bool IsForDebug=false, const TargetRegisterInfo *TRI=nullptr) const
Print the register mask on OS.
void dump(const TargetRegisterInfo *TRI=nullptr) const
Dump the register mask on dbgs() stream.
bool covers(const TargetRegisterClass &RC) const
Check whether this register bank covers RC.
const char * getName() const
Get a user friendly name of this register bank.
unsigned getID() const
Get the identifier of this register bank.
bool operator==(const RegisterBank &OtherRB) const
Check whether OtherRB is the same as this.
unsigned getID() const
Return the register class ID number.
bool hasSubClassEq(const TargetRegisterClass *RC) const
Returns true if RC is a sub-class of or equal to this class.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
int popcount(T Value) noexcept
Count the number of set bits in a value.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.