[PATCH] D76732: [AMDGPU] Fix PC register mapping in wave32 mode

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 11:55:43 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGbd12ecb88f0a: [AMDGPU] Fix PC register mapping in wave32 mode (authored by scott.linder).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76732/new/

https://reviews.llvm.org/D76732

Files:
  llvm/lib/Target/AMDGPU/SIRegisterInfo.td
  llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp
  llvm/unittests/Target/AMDGPU/DwarfRegMappings.cpp


Index: llvm/unittests/Target/AMDGPU/DwarfRegMappings.cpp
===================================================================
--- llvm/unittests/Target/AMDGPU/DwarfRegMappings.cpp
+++ llvm/unittests/Target/AMDGPU/DwarfRegMappings.cpp
@@ -75,10 +75,11 @@
       auto MRI = ST.getRegisterInfo();
       if (MRI) {
         // Wave32 Dwarf register mapping test numbers
-        // PC_32 => 0, EXEC_MASK_32 => 1, S0 => 32, S63 => 95,
+        // PC_64 => 16, EXEC_MASK_32 => 1, S0 => 32, S63 => 95,
         // S64 => 1088, S105 => 1129, V0 => 1536, V255 => 1791,
         // A0 => 2048, A255 => 2303
-        for (int llvmReg : {0, 1, 32, 95, 1088, 1129, 1536, 1791, 2048, 2303}) {
+        for (int llvmReg :
+             {16, 1, 32, 95, 1088, 1129, 1536, 1791, 2048, 2303}) {
           MCRegister PCReg(*MRI->getLLVMRegNum(llvmReg, false));
           EXPECT_EQ(llvmReg, MRI->getDwarfRegNum(PCReg, false));
         }
Index: llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp
===================================================================
--- llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp
+++ llvm/unittests/MC/AMDGPU/DwarfRegMappings.cpp
@@ -65,10 +65,10 @@
     if (TM && TM->getMCRegisterInfo()) {
       auto MRI = TM->getMCRegisterInfo();
       // Wave32 Dwarf register mapping test numbers
-      // PC_32 => 0, EXEC_MASK_32 => 1, S0 => 32, S63 => 95,
+      // PC_64 => 16, EXEC_MASK_32 => 1, S0 => 32, S63 => 95,
       // S64 => 1088, S105 => 1129, V0 => 1536, V255 => 1791,
       // A0 => 2048, A255 => 2303
-      for (int llvmReg : {0, 1, 32, 95, 1088, 1129, 1536, 1791, 2048, 2303}) {
+      for (int llvmReg : {16, 1, 32, 95, 1088, 1129, 1536, 1791, 2048, 2303}) {
         MCRegister PCReg(*MRI->getLLVMRegNum(llvmReg, false));
         EXPECT_EQ(llvmReg, MRI->getDwarfRegNum(PCReg, false));
       }
Index: llvm/lib/Target/AMDGPU/SIRegisterInfo.td
===================================================================
--- llvm/lib/Target/AMDGPU/SIRegisterInfo.td
+++ llvm/lib/Target/AMDGPU/SIRegisterInfo.td
@@ -103,7 +103,7 @@
 def SP_REG : SIReg<"sp", 0>;
 
 // Pseudo-register to represent the program-counter DWARF register.
-def PC_REG : SIReg<"pc", 0>, DwarfRegNum<[16, 0]> {
+def PC_REG : SIReg<"pc", 0>, DwarfRegNum<[16, 16]> {
   // There is no physical register corresponding to a "program counter", but
   // we need to encode the concept in debug information in order to represent
   // things like the return value in unwind information.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76732.252928.patch
Type: text/x-patch
Size: 2468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200326/80a4af5c/attachment.bin>


More information about the llvm-commits mailing list