26#define DEBUG_TYPE "nvptx-reg-info"
29 if (RC == &NVPTX::B128RegClass)
31 if (RC == &NVPTX::B64RegClass)
51 if (RC == &NVPTX::B32RegClass)
53 if (RC == &NVPTX::B16RegClass)
55 if (RC == &NVPTX::B1RegClass)
57 if (RC == &NVPTX::SpecialRegsRegClass)
63 if (RC == &NVPTX::B128RegClass)
65 if (RC == &NVPTX::B64RegClass)
67 if (RC == &NVPTX::B32RegClass)
69 if (RC == &NVPTX::B16RegClass)
71 if (RC == &NVPTX::B1RegClass)
73 if (RC == &NVPTX::SpecialRegsRegClass)
81#define GET_REGINFO_TARGET_DESC
82#include "NVPTXGenRegisterInfo.inc"
87 static const MCPhysReg CalleeSavedRegs[] = { 0 };
88 return CalleeSavedRegs;
93 for (
unsigned Reg = NVPTX::ENVREG0; Reg <= NVPTX::ENVREG31; ++Reg) {
96 markSuperRegs(
Reserved, NVPTX::VRFrame32);
97 markSuperRegs(
Reserved, NVPTX::VRFrameLocal32);
98 markSuperRegs(
Reserved, NVPTX::VRFrame64);
99 markSuperRegs(
Reserved, NVPTX::VRFrameLocal64);
100 markSuperRegs(
Reserved, NVPTX::VRDepot);
105 int SPAdj,
unsigned FIOperandNum,
107 assert(SPAdj == 0 &&
"Unexpected");
110 if (
MI.isLifetimeMarker()) {
111 MI.eraseFromParent();
115 const int FrameIndex =
MI.getOperand(FIOperandNum).getIndex();
120 MI.getOperand(FIOperandNum + 1).getImm();
128 MI.getOperand(FIOperandNum).ChangeToRegister(FrameReg,
false);
129 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(
Offset);
136 return TM.
is64Bit() ? NVPTX::VRFrame64 : NVPTX::VRFrame32;
142 ? NVPTX::VRFrameLocal64
143 : NVPTX::VRFrameLocal32;
147 debugRegisterMap.clear();
151 if (RegisterName.
size() > 8)
162 for (
unsigned char c : RegisterName)
163 result = (result << 8) | c;
172 debugRegisterMap.insert({preEncodedVirtualRegister, mapped});
180 if (RegNum.
id() == NVPTX::VRDepot)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements the BitVector class.
static bool lookup(const GsymReader &GR, GsymDataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs, llvm::Error &Err)
A Lookup helper functions.
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.
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
Representation of each machine instruction.
static const char * getRegisterName(MCRegister Reg)
void clearDebugRegisterMap() 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
void addToDebugRegisterMap(uint64_t preEncodedVirtualRegister, StringRef RegisterName) const
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.
constexpr unsigned id() const
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.
StringRef getNVPTXRegClassStr(const TargetRegisterClass *RC)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
StringRef getNVPTXRegClassName(const TargetRegisterClass *RC)
MCRegisterClass TargetRegisterClass