Skip to content

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Sep 22, 2025

Since #154205 some subtargets can use up to 32 user SGPRs. Add names for
them all so they can be pretty printed in PAL metadata.

Since llvm#154205 some subtargets can use up to 32 user SGPRs. Add names for
them all so they can be pretty printed in PAL metadata.
@llvmbot
Copy link
Member

llvmbot commented Sep 22, 2025

@llvm/pr-subscribers-backend-amdgpu

Author: Jay Foad (jayfoad)

Changes

Since #154205 some subtargets can use up to 32 user SGPRs. Add names for
them all so they can be pretty printed in PAL metadata.


Full diff: https://github.com/llvm/llvm-project/pull/160126.diff

2 Files Affected:

  • (modified) llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp (+16)
  • (modified) llvm/test/MC/AMDGPU/pal-registers.s (+32)
diff --git a/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp b/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp
index a7a0e33da5e4a..8e601ad8a48fd 100644
--- a/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp
+++ b/llvm/lib/Target/AMDGPU/Utils/AMDGPUPALMetadata.cpp
@@ -681,6 +681,22 @@ static const char *getRegisterName(unsigned RegNum) {
       {0x2e4d, "COMPUTE_USER_DATA_13"},
       {0x2e4e, "COMPUTE_USER_DATA_14"},
       {0x2e4f, "COMPUTE_USER_DATA_15"},
+      {0x2e50, "COMPUTE_USER_DATA_16"},
+      {0x2e51, "COMPUTE_USER_DATA_17"},
+      {0x2e52, "COMPUTE_USER_DATA_18"},
+      {0x2e53, "COMPUTE_USER_DATA_19"},
+      {0x2e54, "COMPUTE_USER_DATA_20"},
+      {0x2e55, "COMPUTE_USER_DATA_21"},
+      {0x2e56, "COMPUTE_USER_DATA_22"},
+      {0x2e57, "COMPUTE_USER_DATA_23"},
+      {0x2e58, "COMPUTE_USER_DATA_24"},
+      {0x2e59, "COMPUTE_USER_DATA_25"},
+      {0x2e5a, "COMPUTE_USER_DATA_26"},
+      {0x2e5b, "COMPUTE_USER_DATA_27"},
+      {0x2e5c, "COMPUTE_USER_DATA_28"},
+      {0x2e5d, "COMPUTE_USER_DATA_29"},
+      {0x2e5e, "COMPUTE_USER_DATA_30"},
+      {0x2e5f, "COMPUTE_USER_DATA_31"},
 
       {0x2e07, "COMPUTE_NUM_THREAD_X"},
       {0x2e08, "COMPUTE_NUM_THREAD_Y"},
diff --git a/llvm/test/MC/AMDGPU/pal-registers.s b/llvm/test/MC/AMDGPU/pal-registers.s
index 3080518b7eb0a..839b3126a131b 100644
--- a/llvm/test/MC/AMDGPU/pal-registers.s
+++ b/llvm/test/MC/AMDGPU/pal-registers.s
@@ -258,6 +258,22 @@ amdpal.pipelines:
       0x2e4d: 0
       0x2e4e: 0
       0x2e4f: 0
+      0x2e50: 0
+      0x2e51: 0
+      0x2e52: 0
+      0x2e53: 0
+      0x2e54: 0
+      0x2e55: 0
+      0x2e56: 0
+      0x2e57: 0
+      0x2e58: 0
+      0x2e59: 0
+      0x2e5a: 0
+      0x2e5b: 0
+      0x2e5c: 0
+      0x2e5d: 0
+      0x2e5e: 0
+      0x2e5f: 0
       0xa08f: 0
       0xa191: 0
       0xa192: 0
@@ -596,6 +612,22 @@ amdpal.pipelines:
 // CHECK: 0x2e4d (COMPUTE_USER_DATA_13)
 // CHECK: 0x2e4e (COMPUTE_USER_DATA_14)
 // CHECK: 0x2e4f (COMPUTE_USER_DATA_15)
+// CHECK: 0x2e50 (COMPUTE_USER_DATA_16)
+// CHECK: 0x2e51 (COMPUTE_USER_DATA_17)
+// CHECK: 0x2e52 (COMPUTE_USER_DATA_18)
+// CHECK: 0x2e53 (COMPUTE_USER_DATA_19)
+// CHECK: 0x2e54 (COMPUTE_USER_DATA_20)
+// CHECK: 0x2e55 (COMPUTE_USER_DATA_21)
+// CHECK: 0x2e56 (COMPUTE_USER_DATA_22)
+// CHECK: 0x2e57 (COMPUTE_USER_DATA_23)
+// CHECK: 0x2e58 (COMPUTE_USER_DATA_24)
+// CHECK: 0x2e59 (COMPUTE_USER_DATA_25)
+// CHECK: 0x2e5a (COMPUTE_USER_DATA_26)
+// CHECK: 0x2e5b (COMPUTE_USER_DATA_27)
+// CHECK: 0x2e5c (COMPUTE_USER_DATA_28)
+// CHECK: 0x2e5d (COMPUTE_USER_DATA_29)
+// CHECK: 0x2e5e (COMPUTE_USER_DATA_30)
+// CHECK: 0x2e5f (COMPUTE_USER_DATA_31)
 // CHECK: 0xa08f (CB_SHADER_MASK)
 // CHECK: 0xa191 (SPI_PS_INPUT_CNTL_0)
 // CHECK: 0xa192 (SPI_PS_INPUT_CNTL_1)

@jayfoad jayfoad merged commit d65c7ac into llvm:main Sep 23, 2025
11 checks passed
@jayfoad jayfoad deleted the pal-metadata-32-user-sgprs branch September 23, 2025 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants