1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -run-pass=si-insert-skips -amdgpu-skip-threshold=1000000 -o - %s | FileCheck %s
5 name: skip_branch_taildup_endpgm
9 ; CHECK-LABEL: name: skip_branch_taildup_endpgm
11 ; CHECK: successors: %bb.3(0x40000000), %bb.1(0x40000000)
12 ; CHECK: renamable $sgpr0_sgpr1 = S_LOAD_DWORDX2_IMM renamable $sgpr4_sgpr5, 4, 0, 0 :: (dereferenceable invariant load 8, align 16, addrspace 4)
13 ; CHECK: renamable $vgpr0 = V_LSHLREV_B32_e32 2, killed $vgpr0, implicit $exec
14 ; CHECK: S_WAITCNT 127
15 ; CHECK: $vgpr1 = V_MOV_B32_e32 $sgpr1, implicit $exec, implicit $exec
16 ; CHECK: renamable $vgpr0 = V_ADD_I32_e32 $sgpr0, killed $vgpr0, implicit-def $vcc, implicit $exec
17 ; CHECK: renamable $vgpr1 = V_ADDC_U32_e32 0, killed $vgpr1, implicit-def $vcc, implicit killed $vcc, implicit $exec
18 ; CHECK: renamable $vgpr0 = FLAT_LOAD_DWORD renamable $vgpr0_vgpr1, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (load 4, addrspace 1)
19 ; CHECK: renamable $sgpr0_sgpr1 = S_LOAD_DWORDX2_IMM killed renamable $sgpr4_sgpr5, 0, 0, 0 :: (dereferenceable invariant load 8, align 16, addrspace 4)
20 ; CHECK: S_WAITCNT 112
21 ; CHECK: V_CMP_NE_U32_e32 0, killed $vgpr0, implicit-def $vcc, implicit $exec
22 ; CHECK: $sgpr2_sgpr3 = S_AND_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
23 ; CHECK: renamable $sgpr2_sgpr3 = S_XOR_B64 $exec, killed renamable $sgpr2_sgpr3, implicit-def dead $scc
24 ; CHECK: SI_MASK_BRANCH %bb.1, implicit $exec
25 ; CHECK: S_CBRANCH_EXECZ %bb.1, implicit $exec
26 ; CHECK: S_BRANCH %bb.3
28 ; CHECK: successors: %bb.4(0x40000000), %bb.2(0x40000000)
29 ; CHECK: renamable $sgpr2_sgpr3 = S_OR_SAVEEXEC_B64 killed renamable $sgpr2_sgpr3, implicit-def $exec, implicit-def $scc, implicit $exec
30 ; CHECK: $exec = S_XOR_B64 $exec, renamable $sgpr2_sgpr3, implicit-def $scc
31 ; CHECK: SI_MASK_BRANCH %bb.2, implicit $exec
32 ; CHECK: S_CBRANCH_EXECZ %bb.2, implicit $exec
33 ; CHECK: S_BRANCH %bb.4
35 ; CHECK: $exec = S_OR_B64 $exec, killed renamable $sgpr2_sgpr3, implicit-def $scc
36 ; CHECK: renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
39 ; CHECK: successors: %bb.4(0x40000000), %bb.2(0x40000000)
40 ; CHECK: renamable $vgpr2 = V_MOV_B32_e32 15, implicit $exec
41 ; CHECK: $vgpr0 = V_MOV_B32_e32 $sgpr0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $sgpr0_sgpr1
42 ; CHECK: $vgpr1 = V_MOV_B32_e32 $sgpr1, implicit $exec, implicit $sgpr0_sgpr1, implicit $exec
43 ; CHECK: renamable $sgpr2_sgpr3 = S_OR_SAVEEXEC_B64 killed renamable $sgpr2_sgpr3, implicit-def $exec, implicit-def $scc, implicit $exec
44 ; CHECK: $exec = S_XOR_B64 $exec, renamable $sgpr2_sgpr3, implicit-def $scc
45 ; CHECK: SI_MASK_BRANCH %bb.2, implicit $exec
46 ; CHECK: S_CBRANCH_EXECZ %bb.2, implicit $exec
48 ; CHECK: renamable $vgpr2 = V_MOV_B32_e32 8, implicit $exec
49 ; CHECK: $vgpr0 = V_MOV_B32_e32 $sgpr0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $sgpr0_sgpr1
50 ; CHECK: $vgpr1 = V_MOV_B32_e32 $sgpr1, implicit $exec, implicit killed $sgpr0_sgpr1, implicit $exec
51 ; CHECK: $exec = S_OR_B64 $exec, killed renamable $sgpr2_sgpr3, implicit-def $scc
52 ; CHECK: renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
55 successors: %bb.1, %bb.2
56 liveins: $vgpr0, $sgpr4_sgpr5, $sgpr7
58 renamable $sgpr0_sgpr1 = S_LOAD_DWORDX2_IMM renamable $sgpr4_sgpr5, 4, 0, 0 :: (dereferenceable invariant load 8, align 16, addrspace 4)
59 renamable $vgpr0 = V_LSHLREV_B32_e32 2, killed $vgpr0, implicit $exec
61 $vgpr1 = V_MOV_B32_e32 $sgpr1, implicit $exec, implicit $exec
62 renamable $vgpr0 = V_ADD_I32_e32 $sgpr0, killed $vgpr0, implicit-def $vcc, implicit $exec
63 renamable $vgpr1 = V_ADDC_U32_e32 0, killed $vgpr1, implicit-def $vcc, implicit killed $vcc, implicit $exec
64 renamable $vgpr0 = FLAT_LOAD_DWORD renamable $vgpr0_vgpr1, 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (load 4, addrspace 1)
65 renamable $sgpr0_sgpr1 = S_LOAD_DWORDX2_IMM killed renamable $sgpr4_sgpr5, 0, 0, 0 :: (dereferenceable invariant load 8, align 16, addrspace 4)
67 V_CMP_NE_U32_e32 0, killed $vgpr0, implicit-def $vcc, implicit $exec
68 $sgpr2_sgpr3 = S_AND_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
69 renamable $sgpr2_sgpr3 = S_XOR_B64 $exec, killed renamable $sgpr2_sgpr3, implicit-def dead $scc
70 SI_MASK_BRANCH %bb.2, implicit $exec
74 successors: %bb.3, %bb.4
75 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
77 renamable $sgpr2_sgpr3 = S_OR_SAVEEXEC_B64 killed renamable $sgpr2_sgpr3, implicit-def $exec, implicit-def $scc, implicit $exec
78 $exec = S_XOR_B64 $exec, renamable $sgpr2_sgpr3, implicit-def $scc
79 SI_MASK_BRANCH %bb.4, implicit $exec
85 $exec = S_OR_B64 $exec, killed renamable $sgpr2_sgpr3, implicit-def $scc
86 renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
90 successors: %bb.3, %bb.4
91 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
93 renamable $vgpr2 = V_MOV_B32_e32 15, implicit $exec
94 $vgpr0 = V_MOV_B32_e32 $sgpr0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $sgpr0_sgpr1
95 $vgpr1 = V_MOV_B32_e32 $sgpr1, implicit $exec, implicit $sgpr0_sgpr1, implicit $exec
96 renamable $sgpr2_sgpr3 = S_OR_SAVEEXEC_B64 killed renamable $sgpr2_sgpr3, implicit-def $exec, implicit-def $scc, implicit $exec
97 $exec = S_XOR_B64 $exec, renamable $sgpr2_sgpr3, implicit-def $scc
98 SI_MASK_BRANCH %bb.4, implicit $exec
102 liveins: $sgpr0_sgpr1, $sgpr2_sgpr3
104 renamable $vgpr2 = V_MOV_B32_e32 8, implicit $exec
105 $vgpr0 = V_MOV_B32_e32 $sgpr0, implicit $exec, implicit-def $vgpr0_vgpr1, implicit $sgpr0_sgpr1
106 $vgpr1 = V_MOV_B32_e32 $sgpr1, implicit $exec, implicit killed $sgpr0_sgpr1, implicit $exec
107 $exec = S_OR_B64 $exec, killed renamable $sgpr2_sgpr3, implicit-def $scc
108 renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
114 name: skip_branch_taildup_ret
116 ; CHECK-LABEL: name: skip_branch_taildup_ret
118 ; CHECK: successors: %bb.3(0x40000000), %bb.1(0x40000000)
120 ; CHECK: V_CMP_NE_U32_e32 0, killed $vgpr0, implicit-def $vcc, implicit $exec
121 ; CHECK: $sgpr6_sgpr7 = S_AND_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
122 ; CHECK: renamable $sgpr6_sgpr7 = S_XOR_B64 $exec, killed renamable $sgpr6_sgpr7, implicit-def dead $scc
123 ; CHECK: SI_MASK_BRANCH %bb.1, implicit $exec
124 ; CHECK: S_CBRANCH_EXECZ %bb.1, implicit $exec
125 ; CHECK: S_BRANCH %bb.3
127 ; CHECK: successors: %bb.4(0x40000000), %bb.2(0x40000000)
128 ; CHECK: renamable $sgpr6_sgpr7 = S_OR_SAVEEXEC_B64 killed renamable $sgpr6_sgpr7, implicit-def $exec, implicit-def $scc, implicit $exec
129 ; CHECK: $exec = S_XOR_B64 $exec, renamable $sgpr6_sgpr7, implicit-def $scc
130 ; CHECK: SI_MASK_BRANCH %bb.2, implicit $exec
131 ; CHECK: S_CBRANCH_EXECZ %bb.2, implicit $exec
132 ; CHECK: S_BRANCH %bb.4
134 ; CHECK: $exec = S_OR_B64 $exec, killed renamable $sgpr6_sgpr7, implicit-def $scc
135 ; CHECK: renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
136 ; CHECK: S_SETPC_B64_return $sgpr30_sgpr31
138 ; CHECK: successors: %bb.4(0x40000000), %bb.2(0x40000000)
139 ; CHECK: renamable $vgpr0 = V_MOV_B32_e32 15, implicit $exec
140 ; CHECK: renamable $sgpr6_sgpr7 = S_OR_SAVEEXEC_B64 killed renamable $sgpr6_sgpr7, implicit-def $exec, implicit-def $scc, implicit $exec
141 ; CHECK: $exec = S_XOR_B64 $exec, renamable $sgpr6_sgpr7, implicit-def $scc
142 ; CHECK: SI_MASK_BRANCH %bb.2, implicit $exec
143 ; CHECK: S_CBRANCH_EXECZ %bb.2, implicit $exec
145 ; CHECK: renamable $vgpr0 = V_MOV_B32_e32 8, implicit $exec
146 ; CHECK: $exec = S_OR_B64 $exec, killed renamable $sgpr6_sgpr7, implicit-def $scc
147 ; CHECK: renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
148 ; CHECK: S_SETPC_B64_return $sgpr30_sgpr31
150 successors: %bb.1, %bb.2
151 liveins: $vgpr0, $sgpr30_sgpr31, $vgpr1_vgpr2
154 V_CMP_NE_U32_e32 0, killed $vgpr0, implicit-def $vcc, implicit $exec
155 $sgpr6_sgpr7 = S_AND_SAVEEXEC_B64 $vcc, implicit-def $exec, implicit-def $scc, implicit $exec
156 renamable $sgpr6_sgpr7 = S_XOR_B64 $exec, killed renamable $sgpr6_sgpr7, implicit-def dead $scc
157 SI_MASK_BRANCH %bb.2, implicit $exec
161 successors: %bb.3, %bb.4
162 liveins: $sgpr6_sgpr7, $sgpr30_sgpr31, $vgpr1_vgpr2
164 renamable $sgpr6_sgpr7 = S_OR_SAVEEXEC_B64 killed renamable $sgpr6_sgpr7, implicit-def $exec, implicit-def $scc, implicit $exec
165 $exec = S_XOR_B64 $exec, renamable $sgpr6_sgpr7, implicit-def $scc
166 SI_MASK_BRANCH %bb.4, implicit $exec
170 liveins: $sgpr6_sgpr7, $sgpr30_sgpr31
172 $exec = S_OR_B64 $exec, killed renamable $sgpr6_sgpr7, implicit-def $scc
173 renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
174 S_SETPC_B64_return $sgpr30_sgpr31
177 successors: %bb.3, %bb.4
178 liveins: $sgpr6_sgpr7, $sgpr30_sgpr31, $vgpr1_vgpr2
180 renamable $vgpr0 = V_MOV_B32_e32 15, implicit $exec
181 renamable $sgpr6_sgpr7 = S_OR_SAVEEXEC_B64 killed renamable $sgpr6_sgpr7, implicit-def $exec, implicit-def $scc, implicit $exec
182 $exec = S_XOR_B64 $exec, renamable $sgpr6_sgpr7, implicit-def $scc
183 SI_MASK_BRANCH %bb.4, implicit $exec
187 liveins: $sgpr6_sgpr7, $sgpr30_sgpr31, $vgpr1_vgpr2
189 renamable $vgpr0 = V_MOV_B32_e32 8, implicit $exec
190 $exec = S_OR_B64 $exec, killed renamable $sgpr6_sgpr7, implicit-def $scc
191 renamable $vgpr0 = V_MOV_B32_e32 32, implicit $exec
192 S_SETPC_B64_return $sgpr30_sgpr31