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>
20 lines
884 B
YAML
20 lines
884 B
YAML
# RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefixes=GCN,GFX10 %s
|
|
# RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefixes=GCN,GFX11 %s
|
|
|
|
# GCN-LABEL: waitcnt-vscnt
|
|
# GCN: GLOBAL_ATOMIC_ADD_RTN
|
|
# GFX10-NEXT: S_WAITCNT .Lgkmcnt_0
|
|
# GFX11-NEXT: S_WAITCNT .Lgkmcnt_0
|
|
---
|
|
name: waitcnt-vscnt
|
|
machineFunctionInfo:
|
|
isEntryFunction: true
|
|
body: |
|
|
bb.0:
|
|
liveins: $sgpr0_sgpr1
|
|
$sgpr4 = S_LOAD_DWORD_IMM $sgpr0_sgpr1, 4, 0 :: (dereferenceable invariant load (s32) from `ptr addrspace(4) poison`)
|
|
S_WAITCNT_VSCNT_soft undef $sgpr_null, 0
|
|
$vgpr0 = GLOBAL_ATOMIC_ADD_RTN $vgpr0_vgpr1, $vgpr2, 0, 1, implicit $exec :: (load store syncscope("agent") seq_cst (s32), addrspace 1)
|
|
S_CMP_LG_U32 killed $sgpr4, 0, implicit-def $scc
|
|
...
|