1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=kaveri -verify-machineinstrs -run-pass=prologepilog -o - %s | FileCheck -check-prefix=GCN %s
5 name: func_add_constant_to_fi_divergent_i32
6 tracksRegLiveness: true
8 - { id: 0, type: default, offset: 0, size: 8, alignment: 4,
9 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
10 local-offset: 0, debug-info-variable: '', debug-info-expression: '',
11 debug-info-location: '' }
13 stackPtrOffsetReg: '$sgpr32'
17 liveins: $vgpr31, $sgpr30_sgpr31
19 ; GCN-LABEL: name: func_add_constant_to_fi_divergent_i32
20 ; GCN: liveins: $vgpr31, $sgpr30_sgpr31
22 ; GCN-NEXT: renamable $vgpr0 = V_AND_B32_e32 1023, killed $vgpr31, implicit $exec
23 ; GCN-NEXT: renamable $vgpr0 = V_LSHLREV_B32_e32 2, killed $vgpr0, implicit $exec
24 ; GCN-NEXT: $vgpr1 = V_LSHRREV_B32_e64 6, $sgpr32, implicit $exec
25 ; GCN-NEXT: renamable $vgpr0 = V_ADD_CO_U32_e32 killed $vgpr1, killed $vgpr0, implicit-def dead $vcc, implicit $exec
26 ; GCN-NEXT: renamable $vgpr0, dead renamable $vcc = nuw V_ADD_CO_U32_e64 4, killed $vgpr0, 0, implicit $exec
27 ; GCN-NEXT: $m0 = S_MOV_B32 -1
28 ; GCN-NEXT: DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
29 ; GCN-NEXT: S_SETPC_B64_return killed renamable $sgpr30_sgpr31
30 renamable $vgpr0 = V_AND_B32_e32 1023, killed $vgpr31, implicit $exec
31 renamable $vgpr0 = V_LSHLREV_B32_e32 2, killed $vgpr0, implicit $exec
32 renamable $vgpr0 = V_ADD_CO_U32_e32 %stack.0, killed $vgpr0, implicit-def dead $vcc, implicit $exec
33 renamable $vgpr0, dead renamable $vcc = nuw V_ADD_CO_U32_e64 4, killed $vgpr0, 0, implicit $exec
35 DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
36 S_SETPC_B64_return killed renamable $sgpr30_sgpr31
40 name: func_add_constant_to_fi_uniform_i32
41 tracksRegLiveness: true
43 - { id: 0, type: default, offset: 0, size: 8, alignment: 4,
44 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
45 local-offset: 0, debug-info-variable: '', debug-info-expression: '',
46 debug-info-location: '' }
48 stackPtrOffsetReg: '$sgpr32'
51 liveins: $sgpr30_sgpr31
53 ; GCN-LABEL: name: func_add_constant_to_fi_uniform_i32
54 ; GCN: liveins: $sgpr30_sgpr31
56 ; GCN-NEXT: $vcc_hi = S_LSHR_B32 6, $sgpr32, implicit-def dead $scc
57 ; GCN-NEXT: renamable $sgpr4 = nuw S_ADD_I32 killed $vcc_hi, 4, implicit-def dead $scc
58 ; GCN-NEXT: renamable $vgpr0 = COPY killed renamable $sgpr4, implicit $exec
59 ; GCN-NEXT: $m0 = S_MOV_B32 -1
60 ; GCN-NEXT: DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
61 ; GCN-NEXT: S_SETPC_B64_return killed renamable $sgpr30_sgpr31
62 renamable $sgpr4 = nuw S_ADD_I32 %stack.0, 4, implicit-def dead $scc
63 renamable $vgpr0 = COPY killed renamable $sgpr4, implicit $exec
65 DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
66 S_SETPC_B64_return killed renamable $sgpr30_sgpr31
70 name: func_add_constant_to_fi_uniform_SCC_clobber_i32
71 tracksRegLiveness: true
73 - { id: 0, type: default, offset: 0, size: 8, alignment: 4,
74 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
75 local-offset: 0, debug-info-variable: '', debug-info-expression: '',
76 debug-info-location: '' }
77 - { id: 1, type: default, offset: 0, size: 32, alignment: 4,
78 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
79 local-offset: 512, debug-info-variable: '', debug-info-expression: '',
80 debug-info-location: '' }
84 stackPtrOffsetReg: '$sgpr32'
87 liveins: $sgpr30_sgpr31
89 ; GCN-LABEL: name: func_add_constant_to_fi_uniform_SCC_clobber_i32
90 ; GCN: liveins: $sgpr30_sgpr31
92 ; GCN-NEXT: $vcc_hi = S_LSHR_B32 6, $sgpr32, implicit-def dead $scc
93 ; GCN-NEXT: renamable $sgpr4 = nuw S_ADD_U32 killed $vcc_hi, 4, implicit-def $scc
94 ; GCN-NEXT: renamable $sgpr5 = S_ADDC_U32 $sgpr4, 1234567, implicit-def $scc, implicit $scc
95 ; GCN-NEXT: $vcc_hi = S_LSHR_B32 $sgpr32, 6, implicit-def $scc
96 ; GCN-NEXT: $vcc_hi = S_ADD_I32 killed $vcc_hi, 8, implicit-def $scc
97 ; GCN-NEXT: renamable $sgpr6 = S_MUL_I32 killed $vcc_hi, $sgpr5
98 ; GCN-NEXT: renamable $vgpr0 = COPY killed renamable $sgpr6, implicit $exec
99 ; GCN-NEXT: $m0 = S_MOV_B32 -1
100 ; GCN-NEXT: DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
101 ; GCN-NEXT: S_SETPC_B64_return killed renamable $sgpr30_sgpr31
102 renamable $sgpr4 = nuw S_ADD_U32 %stack.0, 4, implicit-def $scc
103 renamable $sgpr5 = S_ADDC_U32 $sgpr4, 1234567, implicit-def $scc, implicit $scc
104 renamable $sgpr6 = S_MUL_I32 %stack.1, $sgpr5
105 renamable $vgpr0 = COPY killed renamable $sgpr6, implicit $exec
107 DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
108 S_SETPC_B64_return killed renamable $sgpr30_sgpr31
112 name: func_other_fi_user_non_inline_imm_offset_i32
113 tracksRegLiveness: true
115 - { id: 0, type: default, offset: 0, size: 512, alignment: 4,
116 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
117 local-offset: 0, debug-info-variable: '', debug-info-expression: '',
118 debug-info-location: '' }
119 - { id: 1, type: default, offset: 0, size: 32, alignment: 4,
120 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
121 local-offset: 512, debug-info-variable: '', debug-info-expression: '',
122 debug-info-location: '' }
124 scratchRSrcReg: '$sgpr0_sgpr1_sgpr2_sgpr3'
125 stackPtrOffsetReg: '$sgpr32'
128 liveins: $sgpr30_sgpr31
130 ; GCN-LABEL: name: func_other_fi_user_non_inline_imm_offset_i32
131 ; GCN: liveins: $sgpr30_sgpr31
133 ; GCN-NEXT: renamable $vgpr0 = V_MOV_B32_e32 7, implicit $exec
134 ; GCN-NEXT: BUFFER_STORE_DWORD_OFFSET killed renamable $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr32, 260, 0, 0, 0, implicit $exec
135 ; GCN-NEXT: $vcc_hi = S_LSHR_B32 $sgpr32, 6, implicit-def $scc
136 ; GCN-NEXT: $vcc_hi = S_ADD_I32 killed $vcc_hi, 512, implicit-def $scc
137 ; GCN-NEXT: renamable $sgpr4 = S_MUL_I32 killed $vcc_hi, 9
138 ; GCN-NEXT: renamable $vgpr0 = COPY killed renamable $sgpr4, implicit $exec
139 ; GCN-NEXT: $m0 = S_MOV_B32 -1
140 ; GCN-NEXT: DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
141 ; GCN-NEXT: S_SETPC_B64_return killed renamable $sgpr30_sgpr31
142 renamable $vgpr0 = V_MOV_B32_e32 7, implicit $exec
143 BUFFER_STORE_DWORD_OFFEN killed renamable $vgpr0, %stack.0, $sgpr0_sgpr1_sgpr2_sgpr3, 0, 260, 0, 0, 0, implicit $exec
144 renamable $sgpr4 = S_MUL_I32 %stack.1, 9
145 renamable $vgpr0 = COPY killed renamable $sgpr4, implicit $exec
147 DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
148 S_SETPC_B64_return killed renamable $sgpr30_sgpr31
152 name: func_add_constant_to_fi_uniform_live_SCC_i32
153 tracksRegLiveness: true
155 - { id: 0, type: default, offset: 0, size: 8, alignment: 4,
156 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
157 local-offset: 0, debug-info-variable: '', debug-info-expression: '',
158 debug-info-location: '' }
162 stackPtrOffsetReg: '$sgpr32'
165 liveins: $sgpr30_sgpr31, $sgpr10
166 ; GCN-LABEL: name: func_add_constant_to_fi_uniform_live_SCC_i32
167 ; GCN: liveins: $sgpr30_sgpr31, $sgpr10
169 ; GCN-NEXT: renamable $sgpr4 = nuw S_ADD_U32 $sgpr10, 4, implicit-def $scc
170 ; GCN-NEXT: $vgpr1 = V_LSHRREV_B32_e64 6, $sgpr32, implicit $exec
171 ; GCN-NEXT: $vcc_hi = V_READFIRSTLANE_B32 $vgpr1, implicit $exec
172 ; GCN-NEXT: renamable $sgpr5 = S_MUL_I32 killed $vcc_hi, $sgpr4
173 ; GCN-NEXT: renamable $sgpr6 = S_ADDC_U32 $sgpr5, 1234567, implicit-def dead $scc, implicit $scc
174 ; GCN-NEXT: renamable $vgpr0 = COPY killed renamable $sgpr6, implicit $exec
175 ; GCN-NEXT: $m0 = S_MOV_B32 -1
176 ; GCN-NEXT: DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
177 ; GCN-NEXT: S_SETPC_B64_return killed renamable $sgpr30_sgpr31
178 renamable $sgpr4 = nuw S_ADD_U32 $sgpr10, 4, implicit-def $scc
179 renamable $sgpr5 = S_MUL_I32 %stack.0, $sgpr4
180 renamable $sgpr6 = S_ADDC_U32 $sgpr5, 1234567, implicit-def dead $scc, implicit $scc
181 renamable $vgpr0 = COPY killed renamable $sgpr6, implicit $exec
183 DS_WRITE_B32 undef renamable $vgpr0, killed renamable $vgpr0, 0, 0, implicit $m0, implicit $exec
184 S_SETPC_B64_return killed renamable $sgpr30_sgpr31