Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

116 lines
4.7 KiB
YAML

# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefix=GFX12 %s
# Test that we can optimize away s_wait_loadcnt at function boundaries when
# the only pending LOAD_CNT events are from GLOBAL_INV (which doesn't write
# to VGPRs).
#
# When a function contains only GLOBAL_INV with no actual VMEM loads pending
# to VGPRs, we should not need to emit s_wait_loadcnt 0 before the return.
---
# Test 1: Only GLOBAL_INV, no VGPR loads - should NOT need S_WAIT_LOADCNT
# before return because GLOBAL_INV doesn't write to VGPRs.
name: func_global_inv_only
tracksRegLiveness: true
machineFunctionInfo:
isEntryFunction: false
body: |
bb.0:
liveins: $sgpr30_sgpr31
; GFX12-LABEL: name: func_global_inv_only
; GFX12: liveins: $sgpr30_sgpr31
; GFX12-NEXT: {{ $}}
; GFX12-NEXT: S_WAIT_LOADCNT_DSCNT .Loadcnt_0_Dscnt_0
; GFX12-NEXT: S_WAIT_EXPCNT 0
; GFX12-NEXT: S_WAIT_SAMPLECNT 0
; GFX12-NEXT: S_WAIT_BVHCNT 0
; GFX12-NEXT: S_WAIT_KMCNT 0
; GFX12-NEXT: GLOBAL_INV 16, implicit $exec
; GFX12-NOT: S_WAIT_LOADCNT
; GFX12-NEXT: S_SETPC_B64_return $sgpr30_sgpr31
GLOBAL_INV 16, implicit $exec
S_SETPC_B64_return $sgpr30_sgpr31
...
---
# Test 2: GLOBAL_INV with actual VGPR load - MUST wait for loadcnt
name: func_global_inv_with_vgpr_load
tracksRegLiveness: true
machineFunctionInfo:
isEntryFunction: false
body: |
bb.0:
liveins: $vgpr0, $sgpr0_sgpr1, $sgpr30_sgpr31
; GFX12-LABEL: name: func_global_inv_with_vgpr_load
; GFX12: liveins: $vgpr0, $sgpr0_sgpr1, $sgpr30_sgpr31
; GFX12-NEXT: {{ $}}
; GFX12-NEXT: S_WAIT_LOADCNT_DSCNT .Loadcnt_0_Dscnt_0
; GFX12-NEXT: S_WAIT_EXPCNT 0
; GFX12-NEXT: S_WAIT_SAMPLECNT 0
; GFX12-NEXT: S_WAIT_BVHCNT 0
; GFX12-NEXT: S_WAIT_KMCNT 0
; GFX12-NEXT: renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr0_sgpr1, killed $vgpr0, 0, 0, implicit $exec :: (load (s32), addrspace 1)
; GFX12-NEXT: GLOBAL_INV 16, implicit $exec
; GFX12-NEXT: S_WAIT_LOADCNT 0
; GFX12-NEXT: S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0
renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr0_sgpr1, killed $vgpr0, 0, 0, implicit $exec :: (load (s32), addrspace 1)
GLOBAL_INV 16, implicit $exec
S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0
...
---
# Test 3: Only VGPR load (no GLOBAL_INV) - MUST wait for loadcnt
name: func_vgpr_load_no_global_inv
tracksRegLiveness: true
machineFunctionInfo:
isEntryFunction: false
body: |
bb.0:
liveins: $vgpr0, $sgpr0_sgpr1, $sgpr30_sgpr31
; GFX12-LABEL: name: func_vgpr_load_no_global_inv
; GFX12: liveins: $vgpr0, $sgpr0_sgpr1, $sgpr30_sgpr31
; GFX12-NEXT: {{ $}}
; GFX12-NEXT: S_WAIT_LOADCNT_DSCNT .Loadcnt_0_Dscnt_0
; GFX12-NEXT: S_WAIT_EXPCNT 0
; GFX12-NEXT: S_WAIT_SAMPLECNT 0
; GFX12-NEXT: S_WAIT_BVHCNT 0
; GFX12-NEXT: S_WAIT_KMCNT 0
; GFX12-NEXT: renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr0_sgpr1, killed $vgpr0, 0, 0, implicit $exec :: (load (s32), addrspace 1)
; GFX12-NEXT: S_WAIT_LOADCNT 0
; GFX12-NEXT: S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0
renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr0_sgpr1, killed $vgpr0, 0, 0, implicit $exec :: (load (s32), addrspace 1)
S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0
...
---
# Test 4: GLOBAL_INV with load already waited on - should NOT need S_WAIT_LOADCNT at return
# The load was waited on when $vgpr0 was used, so only GLOBAL_INV is pending at return.
name: func_global_inv_load_already_waited
tracksRegLiveness: true
machineFunctionInfo:
isEntryFunction: false
body: |
bb.0:
liveins: $vgpr0, $sgpr0_sgpr1, $sgpr30_sgpr31
; GFX12-LABEL: name: func_global_inv_load_already_waited
; GFX12: liveins: $vgpr0, $sgpr0_sgpr1, $sgpr30_sgpr31
; GFX12-NEXT: {{ $}}
; GFX12-NEXT: S_WAIT_LOADCNT_DSCNT .Loadcnt_0_Dscnt_0
; GFX12-NEXT: S_WAIT_EXPCNT 0
; GFX12-NEXT: S_WAIT_SAMPLECNT 0
; GFX12-NEXT: S_WAIT_BVHCNT 0
; GFX12-NEXT: S_WAIT_KMCNT 0
; GFX12-NEXT: renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr0_sgpr1, killed $vgpr0, 0, 0, implicit $exec :: (load (s32), addrspace 1)
; GFX12-NEXT: S_WAIT_LOADCNT 0
; GFX12-NEXT: $vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
; GFX12-NEXT: GLOBAL_INV 16, implicit $exec
; GFX12-NOT: S_WAIT_LOADCNT
; GFX12-NEXT: S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr0_sgpr1, killed $vgpr0, 0, 0, implicit $exec :: (load (s32), addrspace 1)
$vgpr1 = V_MOV_B32_e32 $vgpr0, implicit $exec
GLOBAL_INV 16, implicit $exec
S_SETPC_B64_return $sgpr30_sgpr31, implicit $vgpr0, implicit $vgpr1
...