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-fold-operands,dead-mi-elimination %s -o - | FileCheck -check-prefix=GCN %s
6 # First operand is FI is in a VGPR, other operand is a VGPR
7 name: shrink_vgpr_fi_vgpr_v_add_i32_e64_no_carry_out_use
8 tracksRegLiveness: true
10 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
15 ; GCN-LABEL: name: shrink_vgpr_fi_vgpr_v_add_i32_e64_no_carry_out_use
16 ; GCN: liveins: $vgpr0
17 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
18 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
19 ; GCN: [[V_ADD_I32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_I32_e32 [[V_MOV_B32_e32_]], [[COPY]], implicit-def $vcc, implicit $exec
20 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e32_]]
21 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
22 %1:vgpr_32 = COPY $vgpr0
23 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
24 S_ENDPGM 0, implicit %2
30 # First operand is a VGPR, other operand FI is in a VGPR
31 name: shrink_vgpr_vgpr_fi_v_add_i32_e64_no_carry_out_use
32 tracksRegLiveness: true
34 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
39 ; GCN-LABEL: name: shrink_vgpr_vgpr_fi_v_add_i32_e64_no_carry_out_use
40 ; GCN: liveins: $vgpr0
41 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
42 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
43 ; GCN: [[V_ADD_I32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_I32_e32 [[COPY]], [[V_MOV_B32_e32_]], implicit-def $vcc, implicit $exec
44 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e32_]]
45 %0:vgpr_32 = COPY $vgpr0
46 %1:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
47 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
48 S_ENDPGM 0, implicit %2
54 # First operand is FI is in an SGPR, other operand is a VGPR
55 name: shrink_vgpr_fi_sgpr_v_add_i32_e64_no_carry_out_use
56 tracksRegLiveness: true
58 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
63 ; GCN-LABEL: name: shrink_vgpr_fi_sgpr_v_add_i32_e64_no_carry_out_use
64 ; GCN: liveins: $sgpr0
65 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
66 ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
67 ; GCN: [[V_ADD_I32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_I32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_I32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
68 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e64_]]
69 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
70 %1:sreg_32_xm0 = COPY $sgpr0
71 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
72 S_ENDPGM 0, implicit %2
78 # First operand is an SGPR, other operand FI is in a VGPR
79 name: shrink_sgpr_vgpr_fi_v_add_i32_e64_no_carry_out_use
80 tracksRegLiveness: true
82 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
87 ; GCN-LABEL: name: shrink_sgpr_vgpr_fi_v_add_i32_e64_no_carry_out_use
88 ; GCN: liveins: $sgpr0
89 ; GCN: [[COPY:%[0-9]+]]:sreg_32_xm0 = COPY $sgpr0
90 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
91 ; GCN: [[V_ADD_I32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_I32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_I32_e64 [[V_MOV_B32_e32_]], [[COPY]], 0, implicit $exec
92 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e64_]]
93 %0:sreg_32_xm0 = COPY $sgpr0
94 %1:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
95 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
96 S_ENDPGM 0, implicit %2
102 # First operand is FI is in an SGPR, other operand is a VGPR
103 name: shrink_sgpr_fi_vgpr_v_add_i32_e64_no_carry_out_use
104 tracksRegLiveness: true
106 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
111 ; GCN-LABEL: name: shrink_sgpr_fi_vgpr_v_add_i32_e64_no_carry_out_use
112 ; GCN: liveins: $vgpr0
113 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 %stack.0
114 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
115 ; GCN: [[V_ADD_I32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_I32_e32 [[S_MOV_B32_]], [[COPY]], implicit-def $vcc, implicit $exec
116 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e32_]]
117 %0:sreg_32_xm0 = S_MOV_B32 %stack.0
118 %1:vgpr_32 = COPY $vgpr0
119 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
120 S_ENDPGM 0, implicit %2
126 # First operand is a VGPR, other operand FI is in an SGPR
127 name: shrink_vgpr_sgpr_fi_v_add_i32_e64_no_carry_out_use
128 tracksRegLiveness: true
130 - { id: 0, type: default, offset: 0, size: 64, alignment: 16}
135 ; GCN-LABEL: name: shrink_vgpr_sgpr_fi_v_add_i32_e64_no_carry_out_use
136 ; GCN: liveins: $vgpr0
137 ; GCN: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
138 ; GCN: [[S_MOV_B32_:%[0-9]+]]:sreg_32_xm0 = S_MOV_B32 %stack.0
139 ; GCN: [[V_ADD_I32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_I32_e32 [[S_MOV_B32_]], [[COPY]], implicit-def $vcc, implicit $exec
140 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e32_]]
141 %0:vgpr_32 = COPY $vgpr0
142 %1:sreg_32_xm0 = S_MOV_B32 %stack.0
143 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
144 S_ENDPGM 0, implicit %2
150 # First operand is FI is in a VGPR, other operand is an inline imm in a VGPR
151 name: shrink_vgpr_imm_fi_vgpr_v_add_i32_e64_no_carry_out_use
152 tracksRegLiveness: true
154 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
158 ; GCN-LABEL: name: shrink_vgpr_imm_fi_vgpr_v_add_i32_e64_no_carry_out_use
159 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
160 ; GCN: [[V_ADD_I32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_I32_e32 16, [[V_MOV_B32_e32_]], implicit-def $vcc, implicit $exec
161 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e32_]]
162 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
163 %1:vgpr_32 = V_MOV_B32_e32 16, implicit $exec
164 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
165 S_ENDPGM 0, implicit %2
171 # First operand is an inline imm in a VGPR, other operand FI is in a VGPR
172 name: shrink_vgpr_imm_vgpr_fi_v_add_i32_e64_no_carry_out_use
173 tracksRegLiveness: true
175 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
179 ; GCN-LABEL: name: shrink_vgpr_imm_vgpr_fi_v_add_i32_e64_no_carry_out_use
180 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
181 ; GCN: [[V_ADD_I32_e64_:%[0-9]+]]:vgpr_32, [[V_ADD_I32_e64_1:%[0-9]+]]:sreg_64 = V_ADD_I32_e64 16, [[V_MOV_B32_e32_]], 0, implicit $exec
182 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e64_]]
183 %0:vgpr_32 = V_MOV_B32_e32 16, implicit $exec
184 %1:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
185 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
186 S_ENDPGM 0, implicit %2
192 # First operand is FI is in a VGPR, other operand is an literal constant in a VGPR
193 name: shrink_vgpr_k_fi_vgpr_v_add_i32_e64_no_carry_out_use
194 tracksRegLiveness: true
196 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
200 ; GCN-LABEL: name: shrink_vgpr_k_fi_vgpr_v_add_i32_e64_no_carry_out_use
201 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
202 ; GCN: [[V_ADD_I32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_I32_e32 1234, [[V_MOV_B32_e32_]], implicit-def $vcc, implicit $exec
203 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e32_]]
204 %0:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
205 %1:vgpr_32 = V_MOV_B32_e32 1234, implicit $exec
206 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
207 S_ENDPGM 0, implicit %2
213 # First operand is a literal constant in a VGPR, other operand FI is in a VGPR
214 name: shrink_vgpr_k_vgpr_fi_v_add_i32_e64_no_carry_out_use
215 tracksRegLiveness: true
217 - { id: 0, type: default, offset: 0, size: 64, alignment: 16 }
221 ; GCN-LABEL: name: shrink_vgpr_k_vgpr_fi_v_add_i32_e64_no_carry_out_use
222 ; GCN: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 1234, implicit $exec
223 ; GCN: [[V_ADD_I32_e32_:%[0-9]+]]:vgpr_32 = V_ADD_I32_e32 %stack.0, [[V_MOV_B32_e32_]], implicit-def $vcc, implicit $exec
224 ; GCN: S_ENDPGM 0, implicit [[V_ADD_I32_e32_]]
225 %0:vgpr_32 = V_MOV_B32_e32 1234, implicit $exec
226 %1:vgpr_32 = V_MOV_B32_e32 %stack.0, implicit $exec
227 %2:vgpr_32, %3:sreg_64 = V_ADD_I32_e64 %0, %1, 0, implicit $exec
228 S_ENDPGM 0, implicit %2