Go to the documentation of this file.
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.");
107 constexpr
operator unsigned()
const {
111 unsigned id()
const {
return Reg; }
165 #endif // LLVM_CODEGEN_REGISTER_H
static constexpr unsigned VirtualRegFlag
bool operator==(int Other) const
This is an optimization pass for GlobalISel generic memory operations.
unsigned virtRegIndex() const
Convert a virtual register number to a 0-based index.
static constexpr unsigned FirstStackSlot
static int stackSlot2Index(Register Reg)
Compute the frame index from a register value representing a stack slot.
static constexpr unsigned NoRegister
static Register index2VirtReg(unsigned Index)
Convert a 0-based index to a virtual register number.
Expected< ExpressionValue > max(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
static unsigned getTombstoneKey()
An information struct used to provide DenseMap with the various necessary components for a given valu...
static Register index2StackSlot(int FI)
Convert a non-negative frame index to a stack slot register value.
bool operator!=(unsigned Other) const
static bool isStackSlot(unsigned Reg)
isStackSlot - Sometimes it is useful the be able to store a non-negative frame index in a variable th...
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
bool operator==(unsigned Other) const
Comparisons against register constants.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
static unsigned getEmptyKey()
bool operator!=(MCPhysReg Other) const
bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
bool operator==(MCPhysReg Other) const
bool operator!=(const MCRegister &Other) const
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
bool operator==(const MCRegister &Other) const
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
static bool isEqual(const Register &LHS, const Register &RHS)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool operator==(const Register &Other) const
Comparisons between register objects.
MCRegister asMCReg() const
Utility to check-convert this value to a MCRegister.
bool isStack() const
Return true if this is a stack slot.
Wrapper class representing virtual and physical registers.
bool operator!=(int Other) const
constexpr Register(MCRegister Val)
static bool isEqual(const Function &Caller, const Function &Callee)
static unsigned getHashValue(const Register &Val)
std::optional< std::vector< StOtherPiece > > Other
static bool isStackSlot(unsigned Reg)
This is the portion of the positive number space that is not a physical register.
static unsigned virtReg2Index(Register Reg)
Convert a virtual register number to a 0-based index.
constexpr Register(unsigned Val=0)
bool operator!=(const Register &Other) const
Wrapper class representing physical registers. Should be passed by value.