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.");
49 assert(FI >= 0 &&
"Cannot hold a negative frame index.");
68 assert(Index < (1u << 31) &&
"Index too large for virtual register range.");
93 constexpr operator unsigned()
const {
return Reg; }
95 constexpr unsigned id()
const {
return Reg; }
111 return Reg ==
Other.Reg;
114 return Reg !=
Other.Reg;
117 return Reg ==
Other.id();
120 return Reg !=
Other.id();
160template <>
struct DenseMapInfo<
Register> {
161 static inline Register getEmptyKey() {
162 return DenseMapInfo<unsigned>::getEmptyKey();
164 static inline Register getTombstoneKey() {
165 return DenseMapInfo<unsigned>::getTombstoneKey();
167 static unsigned getHashValue(
const Register &Val) {
168 return DenseMapInfo<unsigned>::getHashValue(Val.id());
202 return VRegOrUnit ==
Other.VRegOrUnit;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Promote Memory to Register
Wrapper class representing physical registers. Should be passed by value.
static constexpr unsigned LastPhysicalReg
static constexpr unsigned NoRegister
static constexpr bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
Wrapper class representing virtual and physical registers.
constexpr bool isStack() const
Return true if this is a stack slot.
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
Register & operator++()
Operators to move from one register to another nearby register by adding an offset.
MCRegister asMCReg() const
Utility to check-convert this value to a MCRegister.
unsigned virtRegIndex() const
Convert a virtual register number to a 0-based index.
int stackSlotIndex() const
Compute the frame index from a register value representing a stack slot.
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
static constexpr unsigned FirstStackSlot
static constexpr unsigned VirtualRegFlag
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
Register & operator+=(unsigned RHS)
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.
constexpr bool operator==(const VirtRegOrUnit &Other) const
constexpr bool isVirtualReg() const
constexpr VirtRegOrUnit(MCRegUnit Unit)
constexpr VirtRegOrUnit(Register Reg)
constexpr MCRegUnit asMCRegUnit() const
constexpr Register asVirtualReg() const
This is an optimization pass for GlobalISel generic memory operations.
GCNRegPressure max(const GCNRegPressure &P1, const GCNRegPressure &P2)
bool isEqual(const GCNRPTracker::LiveRegSet &S1, const GCNRPTracker::LiveRegSet &S2)
unsigned MCRegUnit
Register units are used to compute register aliasing.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...