[llvm] [AMDGPU][MFI] Implement missing deserialization of dynamicVGPRBlockSize (PR #201939)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 04:52:12 PDT 2026


================
@@ -0,0 +1,35 @@
+# RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx1200 -run-pass=none -o - %s | FileCheck %s
+
+# Test that dynamicVGPRBlockSize round-trips through MIR serialization.
+
+--- |
+  define amdgpu_ps void @dynvgpr_roundtrip_no_fn_attr() { ret void }
+  define amdgpu_ps void @dynvgpr_roundtrip_with_fn_attr() #0 { ret void }
+  attributes #0 = { "amdgpu-dynamic-vgpr-block-size" = "16" }
+...
+
+# CHECK-LABEL: name: dynvgpr_roundtrip_no_fn_attr
+# CHECK: dynamicVGPRBlockSize: 32
+
+---
+name: dynvgpr_roundtrip_no_fn_attr
+machineFunctionInfo:
+  dynamicVGPRBlockSize: 32
+body: |
+  bb.0:
+    S_ENDPGM 0
+...
+
+# In this test the function attribute is 16 but MFI is set to 32.
+# The attribute takes precedence over MFI, so check for 16.
----------------
arsenm wrote:

The attribute shouldn't take precedence. Arguably the MFI field shouldn't exist, but the main reason it does exist is so you can directly write MIR without IR. This also makes it different from every other case, which is worse

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


More information about the llvm-commits mailing list