LLVM: lib/CodeGen/RegisterBank.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

16#include "llvm/Config/llvm-config.h"

18

19#define DEBUG_TYPE "registerbank"

20

21using namespace llvm;

22

25 for (unsigned RCId = 0, End = TRI.getNumRegClasses(); RCId != End; ++RCId) {

27

29 continue;

30

31

32

33

34

35

36 for (unsigned SubRCId = 0; SubRCId != End; ++SubRCId) {

38

40 continue;

41

42

43

45 "Size is not big enough for all the subclasses!");

46 assert(covers(SubRC) && "Not all subclasses are covered");

47 }

48 }

49 return true;

50}

51

53 return (CoveredClasses[RC.getID() / 32] & (1U << RC.getID() % 32)) != 0;

54}

55

57

58

59

61 "ID does not uniquely identify a RegisterBank");

62 return &OtherRB == this;

63}

64

65#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)

69#endif

70

74 if (!IsForDebug)

75 return;

76

77 unsigned Count = 0;

78 for (int i = 0, e = ((NumRegClasses + 31) / 32); i != e; ++i)

80

81 OS << "(ID:" << getID() << ")\n"

82 << "Number of Covered register classes: " << Count << '\n';

83

84

85 if (TRI || NumRegClasses == 0)

86 return;

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) {

93

95 OS << LS << TRI->getRegClassName(&RC);

96 }

97}

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.

Definition RegisterBank.cpp:23

LLVM_ABI void print(raw_ostream &OS, bool IsForDebug=false, const TargetRegisterInfo *TRI=nullptr) const

Print the register mask on OS.

Definition RegisterBank.cpp:71

LLVM_ABI void dump(const TargetRegisterInfo *TRI=nullptr) const

Dump the register mask on dbgs() stream.

Definition RegisterBank.cpp:66

LLVM_ABI bool covers(const TargetRegisterClass &RC) const

Check whether this register bank covers RC.

Definition RegisterBank.cpp:52

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.

Definition RegisterBank.cpp:56

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.

constexpr int popcount(T Value) noexcept

Count the number of set bits in a value.

LLVM_ABI raw_ostream & dbgs()

dbgs() - This returns a reference to a raw_ostream for debugging messages.

FunctionAddr VTableAddr Count