Files
llvm-project/llvm/test/CodeGen/AMDGPU/waitcnt-loop-single-basic-block.mir
vporpo d394d153fb [AMDGPU][MIRFormatter] Printer & parser for S_WAITCNT human-readable mask (#193895)
This patch implements a printer and parser for the S_WAITCNT mask. It
prints the mask in a human-readable format, showing the counter values
like `Vmcnt_<NUM>_Expcnt_<NUM>_Lgkmcnt_<NUM>`.

The format matches the printing style of S_WAITCNT_DEPCTR. For example:
```
 S_WAITCNT .Vmcnt_0_Expcnt_0_Lgkmcnt_0
 S_WAITCNT .Expcnt_0
 S_WAITCNT .AllOff
```
Counters at their maximum value (meaning "don't wait") are omitted. When
all counters are at max, `.AllOff` is printed.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-04-28 14:34:46 -07:00

27 lines
886 B
YAML

# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass=si-insert-waitcnts -verify-machineinstrs %s -o - | FileCheck -check-prefix=GCN %s
# Check that the waitcnt propagates info in the case of a single basic block loop
# GCN-LABEL: waitcnt-loop-single-basic-block
# GCN: bb.0
# GCN: S_WAITCNT .Vmcnt_0{{$}}
# GCN-NEXT: GLOBAL_STORE_DWORD
# GCN: S_WAITCNT .Vmcnt_1
# GCN-NEXT: GLOBAL_STORE_DWORD
...
name: waitcnt-loop-single-basic-block
body: |
bb.0:
S_BRANCH %bb.1
bb.1:
GLOBAL_STORE_DWORD $vgpr7_vgpr8, $vgpr11, 0, 0, implicit $exec
$vgpr21 = GLOBAL_LOAD_DWORD $vgpr4_vgpr5, 0, 0, implicit $exec
$vgpr10 = GLOBAL_LOAD_DWORD $vgpr10_vgpr11, 0, 0, implicit $exec
GLOBAL_STORE_DWORD $vgpr14_vgpr15, $vgpr21, 0, 0, implicit $exec
$vgpr11 = GLOBAL_LOAD_DWORD $vgpr11_vgpr12, 0, 0, implicit $exec
S_CBRANCH_SCC1 %bb.1, implicit $scc
bb.2:
S_ENDPGM 0
...