9#ifndef LLVM_CODEGEN_REGISTER_H
10#define LLVM_CODEGEN_REGISTER_H
23 constexpr Register(
unsigned Val = 0) : Reg(Val) {}
36 static_assert(std::numeric_limits<
decltype(Reg)>
::max() >= 0xFFFFFFFF,
37 "Reg isn't large enough to hold full range.");
53 assert(Reg.isStack() &&
"Not a stack slot");
59 assert(FI >= 0 &&
"Cannot hold a negative frame index.");
78 assert(Reg.isVirtual() &&
"Not a virtual register");
85 assert(
Index < (1u << 31) &&
"Index too large for virtual register range.");
101 constexpr operator unsigned()
const {
return Reg; }
103 constexpr unsigned id()
const {
return Reg; }
120 return Reg ==
Other.Reg;
123 return Reg !=
Other.Reg;
126 return Reg ==
Other.id();
129 return Reg !=
Other.id();
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Wrapper class representing physical registers. Should be passed by value.
static constexpr bool isStackSlot(unsigned Reg)
This is the portion of the positive number space that is not a physical register.
static constexpr unsigned NoRegister
static constexpr bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
static constexpr unsigned FirstStackSlot
static constexpr unsigned VirtualRegFlag
Wrapper class representing virtual and physical registers.
constexpr bool isStack() const
Return true if this is a stack slot.
static constexpr bool isStackSlot(unsigned Reg)
isStackSlot - Sometimes it is useful to be able to store a non-negative frame index in a variable tha...
static Register index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
constexpr Register(unsigned Val=0)
constexpr bool operator==(const Register &Other) const
Comparisons between register objects.
constexpr bool operator!=(const Register &Other) const
static int stackSlot2Index(Register Reg)
Compute the frame index from a register value representing a stack slot.
MCRegister asMCReg() const
Utility to check-convert this value to a MCRegister.
static unsigned virtReg2Index(Register Reg)
Convert a virtual register number to a 0-based index.
unsigned virtRegIndex() const
Convert a virtual register number to a 0-based index.
constexpr bool operator==(const MCRegister &Other) const
constexpr bool operator==(unsigned Other) const
Comparisons against register constants.
constexpr bool isValid() const
constexpr bool operator!=(int Other) const
constexpr Register(MCRegister Val)
static Register index2StackSlot(int FI)
Convert a non-negative frame index to a stack slot register value.
constexpr bool operator!=(const MCRegister &Other) const
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
constexpr bool operator!=(MCPhysReg Other) const
constexpr bool operator!=(unsigned Other) const
static constexpr bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
constexpr bool operator==(int Other) const
constexpr bool operator==(MCPhysReg Other) const
static constexpr bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
constexpr unsigned id() const
constexpr bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
This is an optimization pass for GlobalISel generic memory operations.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
static unsigned getTombstoneKey()
static unsigned getHashValue(const Register &Val)
static bool isEqual(const Register &LHS, const Register &RHS)
static unsigned getEmptyKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...