Insert waitcnts for loads and atomics before stores with system scope. Scope is field in instruction encoding and corresponds to desired coherence level in cache hierarchy. Intrinsic stores can set scope in cache policy operand. If volatile keyword is used on generic stores memory legalizer will set scope to system. Generic stores, by default, get lowest scope level. Waitcnts are not required if it is guaranteed that memory is cached. For example vulkan shaders can guarantee this. TODO: implement flag for frontends to give us a hint not to insert waits. Expecting vulkan flag to be implemented as vulkan:private MMRA.
44 lines
2.0 KiB
YAML
44 lines
2.0 KiB
YAML
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
|
|
# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -run-pass=si-memory-legalizer %s -o - | FileCheck -check-prefix=GFX12 %s
|
|
|
|
---
|
|
name: intrinsic_store_system_scope
|
|
body: |
|
|
bb.0:
|
|
liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3, $sgpr4, $vgpr0, $vgpr1, $vgpr2
|
|
|
|
; GFX12-LABEL: name: intrinsic_store_system_scope
|
|
; GFX12: liveins: $sgpr0, $sgpr1, $sgpr2, $sgpr3, $sgpr4, $vgpr0, $vgpr1, $vgpr2
|
|
; GFX12-NEXT: {{ $}}
|
|
; GFX12-NEXT: S_WAIT_LOADCNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_SAMPLECNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_BVHCNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_KMCNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_STORECNT_soft 0
|
|
; GFX12-NEXT: BUFFER_STORE_DWORD_VBUFFER_BOTHEN_exact killed renamable $vgpr0, killed renamable $vgpr1_vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 24, 0, implicit $exec :: (dereferenceable store (s32), align 1, addrspace 8)
|
|
; GFX12-NEXT: S_ENDPGM 0
|
|
BUFFER_STORE_DWORD_VBUFFER_BOTHEN_exact killed renamable $vgpr0, killed renamable $vgpr1_vgpr2, killed renamable $sgpr0_sgpr1_sgpr2_sgpr3, killed renamable $sgpr4, 0, 24, 0, implicit $exec :: (dereferenceable store (s32), align 1, addrspace 8)
|
|
S_ENDPGM 0
|
|
...
|
|
|
|
---
|
|
name: generic_store_volatile
|
|
body: |
|
|
bb.0:
|
|
liveins: $vgpr0, $vgpr1, $vgpr2
|
|
|
|
; GFX12-LABEL: name: generic_store_volatile
|
|
; GFX12: liveins: $vgpr0, $vgpr1, $vgpr2
|
|
; GFX12-NEXT: {{ $}}
|
|
; GFX12-NEXT: S_WAIT_LOADCNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_SAMPLECNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_BVHCNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_KMCNT_soft 0
|
|
; GFX12-NEXT: S_WAIT_STORECNT_soft 0
|
|
; GFX12-NEXT: GLOBAL_STORE_DWORD killed renamable $vgpr1_vgpr2, killed renamable $vgpr0, 0, 24, implicit $exec :: (volatile store (s32), addrspace 1)
|
|
; GFX12-NEXT: S_WAIT_STORECNT_soft 0
|
|
; GFX12-NEXT: S_ENDPGM 0
|
|
GLOBAL_STORE_DWORD killed renamable $vgpr1_vgpr2, killed renamable $vgpr0, 0, 0, implicit $exec :: (volatile store (s32), addrspace 1)
|
|
S_ENDPGM 0
|
|
...
|