Files
TheRock/rocm-libraries/shared/stinkytofu/tests/filecheck/waitcnt_insertion_wmma_dsread.stir
T
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

47 lines
2.4 KiB
Plaintext

# RUN: %stinkytofu-opt --arch gfx1250 %s --StinkyBuildImplicitDependencyPass --StinkyWaitCntInsertionPass --print-output
#
# StinkyWaitCntInsertionPass (gfx1250): insert s_wait_dscnt before each WMMA
# that consumes outstanding ds_load results. The pass inserts an actual
# s_wait_dscnt instruction whose immediate is the number of ds_load results
# that should still be OUTSTANDING after the wait. The inserted instruction
# also carries an `mod.swaitcnt` modifier exposing the semantic fields
# (vlcnt / vscnt / dlcnt / dscnt / kmcnt) that downstream emitters consume.
#
# Pattern (single-block):
# ds_load_b64 v[20:21], v0 (ds_load 0)
# ds_load_b64 v[30:31], v0 (ds_load 1)
# ds_load_b64 v[40:41], v0 (ds_load 2)
# ds_load_b64 v[50:51], v0 (ds_load 3)
# v_wmma_f32_16x16x32_bf16 (uses v[20:27], v[30:37] -> needs ds_load 0,1)
# v_wmma_f32_16x16x32_bf16 (uses v[40:47], v[50:57] -> needs ds_load 2,3)
#
# Expected waits inserted by the pass:
# s_wait_dscnt 2 before WMMA1 (wait for ds_load 0,1 ; leave 2,3 outstanding)
# s_wait_dscnt 0 before WMMA2 (wait for the remaining ds_load 2,3)
#
# CHECK-LABEL: @waitcnt_insertion_wmma_dsread
# CHECK: ds_load_b64
# CHECK-NEXT: ds_load_b64
# CHECK-NEXT: ds_load_b64
# CHECK-NEXT: ds_load_b64
# CHECK-NEXT: s_wait_dscnt
# CHECK-SAME: dlcnt = 2
# CHECK-NEXT: v_wmma_f32_16x16x32_bf16
# CHECK-NEXT: s_wait_dscnt
# CHECK-SAME: dlcnt = 0
# CHECK-NEXT: v_wmma_f32_16x16x32_bf16
# Only two waitcnt inserts should exist, and no tensor waitcnt should appear
# (no tensor loads are present in this block, so the tensor-wait heuristic is a no-op).
# CHECK-NOT: s_wait_tensorcnt
# CHECK-NOT: s_wait_loadcnt
st.func @waitcnt_insertion_wmma_dsread() {
^entry:
v[20:21] = "st.ds_load_b64"(v0) { mod.ds = { na = 1, offset = 0, gds = false }, mod.memtoken = { tokens = [0] } }
v[30:31] = "st.ds_load_b64"(v0) { mod.ds = { na = 1, offset = 16, gds = false }, mod.memtoken = { tokens = [0] } }
v[40:41] = "st.ds_load_b64"(v0) { mod.ds = { na = 1, offset = 32, gds = false }, mod.memtoken = { tokens = [0] } }
v[50:51] = "st.ds_load_b64"(v0) { mod.ds = { na = 1, offset = 48, gds = false }, mod.memtoken = { tokens = [0] } }
a[10:17] = "st.v_wmma_f32_16x16x32_bf16"(v[20:27], v[30:37], a[10:17]) { mod.mfma = { reuseA = false, reuseB = false } }
a[10:17] = "st.v_wmma_f32_16x16x32_bf16"(v[40:47], v[50:57], a[10:17]) { mod.mfma = { reuseA = false, reuseB = false } }
}