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);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Register const TargetRegisterInfo * TRI
A helper class to return the specified delimiter string after the first invocation of operator String...
unsigned getMaximumSize(unsigned RegBankID) const
Get the maximum size in bits that fits in the given register bank.
constexpr RegisterBank(unsigned ID, const char *Name, const uint32_t *CoveredClasses, unsigned NumRegClasses)
LLVM_ABI bool verify(const RegisterBankInfo &RBI, const TargetRegisterInfo &TRI) const
Check if this register bank is valid.
LLVM_ABI void print(raw_ostream &OS, bool IsForDebug=false, const TargetRegisterInfo *TRI=nullptr) const
Print the register mask on OS.
LLVM_ABI void dump(const TargetRegisterInfo *TRI=nullptr) const
Dump the register mask on dbgs() stream.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FunctionAddr VTableAddr Count
int popcount(T Value) noexcept
Count the number of set bits in a value.