9#ifndef LLVM_CODEGEN_REGISTER_H
10#define LLVM_CODEGEN_REGISTER_H
24 constexpr Register(
unsigned Val = 0) : Reg(Val) {}
37 static_assert(std::numeric_limits<
decltype(
Reg)>
::max() >= 0xFFFFFFFF,
38 "Reg isn't large enough to hold full range.");
53 "Frame index must be at most 30 bits.");
73 assert(Index < (1u << 31) &&
"Index too large for virtual register range.");
98 constexpr operator unsigned()
const {
return Reg; }
100 constexpr unsigned id()
const {
return Reg; }
116 return Reg ==
Other.Reg;
119 return Reg !=
Other.Reg;
122 return Reg ==
Other.id();
125 return Reg !=
Other.id();
165template <>
struct DenseMapInfo<
Register> {
166 static inline Register getEmptyKey() {
167 return DenseMapInfo<unsigned>::getEmptyKey();
169 static inline Register getTombstoneKey() {
170 return DenseMapInfo<unsigned>::getTombstoneKey();
172 static unsigned getHashValue(
const Register &Val) {
173 return DenseMapInfo<unsigned>::getHashValue(Val.id());
207 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.
static constexpr unsigned StackSlotZero
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
static constexpr const unsigned StackSlotMask
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 MaxFrameIndexBitwidth
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)
constexpr bool isInt(int64_t x)
Checks if an integer fits into the given bit width.
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...
constexpr int32_t SignExtend32(uint32_t X)
Sign-extend the number in the bottom B bits of X to a 32-bit integer.