LLVM 22.0.0git
llvm::RegisterBank Class Reference

This class implements the register bank concept. More...

#include "llvm/CodeGen/RegisterBank.h"

Public Member Functions

constexpr RegisterBank (unsigned ID, const char *Name, const uint32_t *CoveredClasses, unsigned NumRegClasses)
unsigned getID () const
 Get the identifier of this register bank.
const chargetName () const
 Get a user friendly name of this register bank.
LLVM_ABI bool verify (const RegisterBankInfo &RBI, const TargetRegisterInfo &TRI) const
 Check if this register bank is valid.
LLVM_ABI bool covers (const TargetRegisterClass &RC) const
 Check whether this register bank covers RC.
LLVM_ABI bool operator== (const RegisterBank &OtherRB) const
 Check whether OtherRB is the same as this.
bool operator!= (const RegisterBank &OtherRB) const
LLVM_ABI void dump (const TargetRegisterInfo *TRI=nullptr) const
 Dump the register mask on dbgs() stream.
LLVM_ABI void print (raw_ostream &OS, bool IsForDebug=false, const TargetRegisterInfo *TRI=nullptr) const
 Print the register mask on OS.

Detailed Description

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.

Constructor & Destructor Documentation

◆ RegisterBank()

llvm::RegisterBank::RegisterBank ( unsigned ID,
const char * Name,
const uint32_t * CoveredClasses,
unsigned NumRegClasses )
inlineconstexpr

Definition at line 40 of file RegisterBank.h.

Referenced by operator!=(), and operator==().

Member Function Documentation

◆ covers()

bool RegisterBank::covers ( const TargetRegisterClass & RC) const

◆ dump()

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 66 of file RegisterBank.cpp.

References llvm::dbgs(), LLVM_DUMP_METHOD, print(), and TRI.

◆ getID()

◆ getName()

const char * llvm::RegisterBank::getName ( ) const
inline

Get a user friendly name of this register bank.

Should be used only for debugging purposes.

Definition at line 50 of file RegisterBank.h.

Referenced by print().

◆ operator!=()

bool llvm::RegisterBank::operator!= ( const RegisterBank & OtherRB) const
inline

Definition at line 68 of file RegisterBank.h.

References operator==(), and RegisterBank().

◆ operator==()

bool RegisterBank::operator== ( const RegisterBank & OtherRB) const

Check whether OtherRB is the same as this.

Definition at line 56 of file RegisterBank.cpp.

References assert(), getID(), and RegisterBank().

Referenced by operator!=().

◆ print()

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 71 of file RegisterBank.cpp.

References assert(), llvm::Count, covers(), getID(), getName(), llvm::popcount(), and TRI.

Referenced by dump(), and llvm::operator<<().

◆ verify()

bool RegisterBank::verify ( const RegisterBankInfo & RBI,
const TargetRegisterInfo & TRI ) const

Check if this register bank is valid.

In other words, if it has been properly constructed.

Note
This method does not check anything when assertions are disabled.
Returns
True is the check was successful.

Definition at line 23 of file RegisterBank.cpp.

References assert(), covers(), getID(), llvm::RegisterBankInfo::getMaximumSize(), llvm::TargetRegisterClass::hasSubClassEq(), and TRI.

Referenced by llvm::RegisterBankInfo::verify().


The documentation for this class was generated from the following files: