26#define DEBUG_TYPE "nvptx-reg-info"
30#define GET_REGINFO_TARGET_DESC
31#include "NVPTXGenRegisterInfo.inc"
36 static const MCPhysReg CalleeSavedRegs[] = { 0 };
37 return CalleeSavedRegs;
42 for (
unsigned Reg = NVPTX::ENVREG0; Reg <= NVPTX::ENVREG31; ++Reg) {
45 markSuperRegs(
Reserved, NVPTX::VRFrame32);
46 markSuperRegs(
Reserved, NVPTX::VRFrameLocal32);
47 markSuperRegs(
Reserved, NVPTX::VRFrame64);
48 markSuperRegs(
Reserved, NVPTX::VRFrameLocal64);
49 markSuperRegs(
Reserved, NVPTX::VRDepot);
54 int SPAdj,
unsigned FIOperandNum,
56 assert(SPAdj == 0 &&
"Unexpected");
59 if (
MI.isLifetimeMarker()) {
64 const int FrameIndex =
MI.getOperand(FIOperandNum).getIndex();
69 MI.getOperand(FIOperandNum + 1).getImm();
77 MI.getOperand(FIOperandNum).ChangeToRegister(FrameReg,
false);
78 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(
Offset);
91 ? NVPTX::VRFrameLocal64
92 : NVPTX::VRFrameLocal32;
96 DebugRegisterMap.clear();
100 if (RegisterName.
size() > 8)
111 for (
unsigned char C : RegisterName)
112 Result = (Result << 8) |
C;
119 DebugRegisterMap.insert({VirtReg, Encoded});
127 if (RegNum.
id() == NVPTX::VRDepot)
135 if (
const uint64_t Encoded = DebugRegisterMap.lookup(RegNum))
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements the BitVector class.
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static uint64_t encodeRegisterForDwarf(StringRef RegisterName)
uint64_t IntrinsicInst * II
an instruction to allocate memory on the stack
unsigned getAddressSpace() const
Return the address space for the allocation.
unsigned getPointerSizeInBits(unsigned AS=0) const
The size in bits of the pointer representation in a given address space.
Wrapper class representing physical registers. Should be passed by value.
constexpr unsigned id() const
MachineInstrBundleIterator< MachineInstr > iterator
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
const AllocaInst * getObjectAllocation(int ObjectIdx) const
Return the underlying Alloca of the specified stack object if it exists.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const DataLayout & getDataLayout() const
Return the DataLayout attached to the Module associated to this MF.
Representation of each machine instruction.
static const char * getRegisterName(MCRegister Reg)
void clearDebugRegisterMap() const
void addToDebugRegisterMap(Register VirtReg, StringRef RegisterName) const
Register getFrameLocalRegister(const MachineFunction &MF) const
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
NVPTX Callee Saved Registers.
bool eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
BitVector getReservedRegs(const MachineFunction &MF) const override
int64_t getDwarfRegNum(MCRegister RegNum, bool isEH) const override
Register getFrameRegister(const MachineFunction &MF) const override
int64_t getDwarfRegNumForVirtReg(Register RegNum, bool isEH) const override
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
Represent a constant reference to a string, i.e.
constexpr size_t size() const
Get the string size.
This is an optimization pass for GlobalISel generic memory operations.
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...