24#define DEBUG_TYPE "nvptx-reg-info"
28 if (RC == &NVPTX::Float32RegsRegClass)
30 if (RC == &NVPTX::Float64RegsRegClass)
32 if (RC == &NVPTX::Int128RegsRegClass)
34 if (RC == &NVPTX::Int64RegsRegClass)
54 if (RC == &NVPTX::Int32RegsRegClass)
56 if (RC == &NVPTX::Int16RegsRegClass)
58 if (RC == &NVPTX::Int1RegsRegClass)
60 if (RC == &NVPTX::SpecialRegsRegClass)
66 if (RC == &NVPTX::Float32RegsRegClass)
68 if (RC == &NVPTX::Float64RegsRegClass)
70 if (RC == &NVPTX::Int128RegsRegClass)
72 if (RC == &NVPTX::Int64RegsRegClass)
74 if (RC == &NVPTX::Int32RegsRegClass)
76 if (RC == &NVPTX::Int16RegsRegClass)
78 if (RC == &NVPTX::Int1RegsRegClass)
80 if (RC == &NVPTX::SpecialRegsRegClass)
89#define GET_REGINFO_TARGET_DESC
90#include "NVPTXGenRegisterInfo.inc"
95 static const MCPhysReg CalleeSavedRegs[] = { 0 };
96 return CalleeSavedRegs;
101 for (
unsigned Reg = NVPTX::ENVREG0; Reg <= NVPTX::ENVREG31; ++Reg) {
104 markSuperRegs(
Reserved, NVPTX::VRFrame32);
105 markSuperRegs(
Reserved, NVPTX::VRFrameLocal32);
106 markSuperRegs(
Reserved, NVPTX::VRFrame64);
107 markSuperRegs(
Reserved, NVPTX::VRFrameLocal64);
108 markSuperRegs(
Reserved, NVPTX::VRDepot);
113 int SPAdj,
unsigned FIOperandNum,
115 assert(SPAdj == 0 &&
"Unexpected");
118 int FrameIndex =
MI.getOperand(FIOperandNum).getIndex();
122 MI.getOperand(FIOperandNum + 1).getImm();
126 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(
Offset);
133 return TM.is64Bit() ? NVPTX::VRFrame64 : NVPTX::VRFrame32;
140 return TM.is64Bit() ? NVPTX::VRFrameLocal64 : NVPTX::VRFrameLocal32;
144 debugRegisterMap.
clear();
148 if (registerName.length() > 8) {
160 for (
unsigned char c : registerName)
161 result = (result << 8) | c;
166 uint64_t preEncodedVirtualRegister, std::string registerName)
const {
170 debugRegisterMap.
insert({preEncodedVirtualRegister, mapped});
179 if (RegNum.
id() == NVPTX::VRDepot)
This file implements the BitVector class.
static bool lookup(const GsymReader &GR, DataExtractor &Data, uint64_t &Offset, uint64_t BaseAddr, uint64_t Addr, SourceLocations &SrcLocs, llvm::Error &Err)
A Lookup helper functions.
static uint64_t encodeRegisterForDwarf(std::string registerName)
uint64_t IntrinsicInst * II
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ValueT lookup(const_arg_type_t< KeyT > Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Wrapper class representing physical registers. Should be passed by value.
constexpr unsigned id() const
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 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
void addToDebugRegisterMap(uint64_t preEncodedVirtualRegister, std::string registerName) const
BitVector getReservedRegs(const MachineFunction &MF) const override
int64_t getDwarfRegNum(MCRegister RegNum, bool isEH) const override
Register getFrameRegister(const MachineFunction &MF) const override
Wrapper class representing virtual and physical registers.
static constexpr bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
This is an optimization pass for GlobalISel generic memory operations.
std::string getNVPTXRegClassName(TargetRegisterClass const *RC)
std::string getNVPTXRegClassStr(TargetRegisterClass const *RC)