File: waitcnt-global-inv-wb.mir

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (29 lines) | stat: -rw-r--r-- 1,404 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefix=GFX12 %s

# Check that we correctly track that GLOBAL_INV increases LOAD_cnt.
# We use a straightforward dependency between a GLOBAL_LOAD and an instruction
# that uses its result - the S_WAIT_LOADCNT introduced before the use should
# reflect the fact that there is a GLOBAL_INV between them.
# FIXME: We could get away with a S_WAIT_LOADCNT 1 here.
---
name: waitcnt-global-inv
machineFunctionInfo:
  isEntryFunction: true
body: |
  bb.0:
    liveins: $vgpr0, $vgpr1, $sgpr2_sgpr3

    ; GFX12-LABEL: name: waitcnt-global-inv
    ; GFX12: liveins: $vgpr0, $vgpr1, $sgpr2_sgpr3
    ; GFX12-NEXT: {{  $}}
    ; GFX12-NEXT: renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr2_sgpr3, 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: $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec, implicit $exec
    renamable $vgpr0 = GLOBAL_LOAD_DWORD_SADDR renamable $sgpr2_sgpr3, killed $vgpr0, 0, 0, implicit $exec :: (load (s32), addrspace 1)
    GLOBAL_INV 16, implicit $exec
    $vgpr2 = V_MOV_B32_e32 $vgpr0, implicit $exec, implicit $exec
...

# TODO: Test for GLOBAL_WB, GLOBAL_WBINV