1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx1010 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefix=GFX10 %s
5 name: test_waitcnt_preexisting_vscnt_unmodified
8 liveins: $vgpr0_vgpr1, $vgpr2
10 ; GFX10-LABEL: name: test_waitcnt_preexisting_vscnt_unmodified
12 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
13 ; GFX10: GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
14 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
16 ; GFX10: $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
17 ; GFX10: S_WAITCNT 112
18 ; GFX10: FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
20 GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
21 S_WAITCNT_VSCNT undef $sgpr_null, 0
23 $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
24 FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
29 name: test_waitcnt_preexisting_vscnt_needs_vscnt
32 liveins: $vgpr0_vgpr1, $vgpr2
34 ; GFX10-LABEL: name: test_waitcnt_preexisting_vscnt_needs_vscnt
36 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
37 ; GFX10: GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
38 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
40 ; GFX10: $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
41 ; GFX10: S_WAITCNT 112
42 ; GFX10: FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
44 GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
45 S_WAITCNT_VSCNT undef $sgpr_null, 1
47 $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
48 FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
53 name: test_waitcnt_preexisting_vscnt_with_other_waitcnt
56 liveins: $vgpr0_vgpr1, $vgpr2
58 ; GFX10-LABEL: name: test_waitcnt_preexisting_vscnt_with_other_waitcnt
60 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
61 ; GFX10: GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
62 ; GFX10: S_WAITCNT 112
63 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
65 ; GFX10: $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
66 ; GFX10: S_WAITCNT 112
67 ; GFX10: FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
69 GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
71 S_WAITCNT_VSCNT undef $sgpr_null, 0
73 $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
74 FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
79 name: test_waitcnt_preexisting_vscnt_combined
82 liveins: $vgpr0_vgpr1, $vgpr2
84 ; GFX10-LABEL: name: test_waitcnt_preexisting_vscnt_combined
86 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
87 ; GFX10: GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
88 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
90 ; GFX10: $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
91 ; GFX10: S_WAITCNT 112
92 ; GFX10: FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
94 GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
95 S_WAITCNT_VSCNT undef $sgpr_null, 0
96 S_WAITCNT_VSCNT undef $sgpr_null, 1
97 S_WAITCNT_VSCNT undef $sgpr_null, 2
99 $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
100 FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
105 name: test_waitcnt_preexisting_vscnt_combined_both_types
108 liveins: $vgpr0_vgpr1, $vgpr2
110 ; GFX10-LABEL: name: test_waitcnt_preexisting_vscnt_combined_both_types
112 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
113 ; GFX10: GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
115 ; GFX10: S_WAITCNT_VSCNT undef $sgpr_null, 0
117 ; GFX10: $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
118 ; GFX10: S_WAITCNT 112
119 ; GFX10: FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr
121 GLOBAL_STORE_DWORD $vgpr0_vgpr1, $vgpr2, 0, 0, implicit $exec
123 S_WAITCNT_VSCNT undef $sgpr_null, 1
125 S_WAITCNT_VSCNT undef $sgpr_null, 2
128 $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr
129 FLAT_STORE_DWORD $vgpr0_vgpr1, $vgpr0, 0, 0, implicit $exec, implicit $flat_scr