[llvm-branch-commits] [llvm] [NVPTX] add support for encoding PTX registers for DWARF (PR #109495)

William G Hatch via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Sep 23 12:41:49 PDT 2024


================
@@ -141,3 +142,47 @@ NVPTXRegisterInfo::getFrameLocalRegister(const MachineFunction &MF) const {
       static_cast<const NVPTXTargetMachine &>(MF.getTarget());
   return TM.is64Bit() ? NVPTX::VRFrameLocal64 : NVPTX::VRFrameLocal32;
 }
+
+void NVPTXRegisterInfo::clearDebugRegisterMap() const {
+  debugRegisterMap.clear();
+}
+
+static uint64_t encodeRegisterForDwarf(std::string registerName) {
+  if (registerName.length() > 8) {
+    // The name is more than 8 characters long, and so won't fit into 64 bits.
+    return 0;
+  }
----------------
willghatch wrote:

Actually, no, `%envreg` is long enough that it would only allow 1 digit.

https://github.com/llvm/llvm-project/pull/109495


More information about the llvm-branch-commits mailing list