[llvm] [AMDGPU] IGLP: Fix static variables (PR #137549)

Frederik Harwath via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 06:51:54 PST 2026


================
@@ -0,0 +1,85 @@
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -run-pass=none -o - %s | FileCheck -check-prefix=ROUNDTRIP %s
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx942 -run-pass=postmisched -o - %s | FileCheck -check-prefix=POSTRA %s
+
+# Test that IGLP cache data serializes/deserializes through MIR and is
+# available for PostRA scheduling.
+
+# Verify round-trip of the serialized cache fields.
+# ROUNDTRIP: iglpSmallGemmSingleWaveCaches:
+# ROUNDTRIP-NEXT: - mbb:             1
+# ROUNDTRIP-NEXT:   strategyId:      1
+# ROUNDTRIP-NEXT:   dswCount:        6
+# ROUNDTRIP-NEXT:   dswWithPermCount: 2
+# ROUNDTRIP-NEXT:   dswWithSharedVMEMCount: 0
+# ROUNDTRIP: iglpExpInterleaveCaches:
+# ROUNDTRIP-NEXT: - mbb:             0
+# ROUNDTRIP-NEXT:   strategyId:      2
+# ROUNDTRIP-NEXT:   transPipeCount:  32
+# ROUNDTRIP-NEXT:   mfmaPipeCount:   40
+# ROUNDTRIP-NEXT:   addPipeCount:    33
+# ROUNDTRIP-NEXT:   mfmaEnablement:  2
+# ROUNDTRIP-NEXT:   expRequirement:  4
+# ROUNDTRIP-NEXT:   mfmaChains:      2
+# ROUNDTRIP-NEXT:   mfmaChainLength: 20
+# ROUNDTRIP-NEXT:   hasCvt:          true
+# ROUNDTRIP-NEXT:   hasChainBetweenCvt: false
+# ROUNDTRIP-NEXT:   analysisResult:  true
+
+# Verify PostRA scheduling doesn't crash and passes through the IGLP_OPTs.
+# POSTRA: IGLP_OPT 2
+# POSTRA: V_MFMA
+# POSTRA: IGLP_OPT 1
+--- |
+  define amdgpu_kernel void @iglp_cache_test() #0 { ret void }
+
+  attributes #0 = { "amdgpu-flat-work-group-size"="256,256" }
+...
+---
+name:            iglp_cache_test
+alignment:       1
+tracksRegLiveness: true
+noPhis:          true
+isSSA:           false
+noVRegs:         true
+machineFunctionInfo:
+  isEntryFunction: false
+  occupancy:     5
+  iglpExpInterleaveCaches:
+    - mbb:             0
+      strategyId:      2
+      transPipeCount:  32
+      mfmaPipeCount:   40
+      addPipeCount:    33
+      mfmaEnablement:  2
+      expRequirement:  4
+      mfmaChains:      2
+      mfmaChainLength: 20
+      hasCvt:          true
+      hasChainBetweenCvt: false
+      analysisResult:  true
+  iglpSmallGemmSingleWaveCaches:
----------------
frederik-h wrote:

This checks the cache parsing. Also check cache creation?

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


More information about the llvm-commits mailing list