1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx1150 -verify-machineinstrs -run-pass=si-fold-operands %s -o - | FileCheck %s
5 name: fmac_fold_inlinable_src0_to_fmamk
6 tracksRegLiveness: true
9 liveins: $sgpr0, $sgpr1
11 ; CHECK-LABEL: name: fmac_fold_inlinable_src0_to_fmamk
12 ; CHECK: liveins: $sgpr0, $sgpr1
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
15 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
16 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAMK_F32 [[COPY]], 1056964608, [[COPY1]], implicit $mode
17 ; CHECK-NEXT: $sgpr0 = COPY %fma
18 %0:sreg_32 = COPY $sgpr0
19 %1:sreg_32 = COPY $sgpr1
20 %inlinable:sreg_32 = S_MOV_B32 1056964608
21 %fma:sreg_32 = nofpexcept S_FMAC_F32 %inlinable, %0, %1, implicit $mode
25 name: fmac_fold_inlinable_src1_to_fmamk
26 tracksRegLiveness: true
29 liveins: $sgpr0, $sgpr1
31 ; CHECK-LABEL: name: fmac_fold_inlinable_src1_to_fmamk
32 ; CHECK: liveins: $sgpr0, $sgpr1
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
35 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
36 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAMK_F32 [[COPY]], 1056964608, [[COPY1]], implicit $mode
37 ; CHECK-NEXT: $sgpr0 = COPY %fma
38 %0:sreg_32 = COPY $sgpr0
39 %1:sreg_32 = COPY $sgpr1
40 %inlinable:sreg_32 = S_MOV_B32 1056964608
41 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %inlinable, %1, implicit $mode
45 name: fmac_fold_inlinable_src2_to_fmaak
46 tracksRegLiveness: true
49 liveins: $sgpr0, $sgpr1
51 ; CHECK-LABEL: name: fmac_fold_inlinable_src2_to_fmaak
52 ; CHECK: liveins: $sgpr0, $sgpr1
54 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
55 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
56 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAAK_F32 [[COPY]], [[COPY1]], 1056964608, implicit $mode
57 ; CHECK-NEXT: $sgpr0 = COPY %fma
58 %0:sreg_32 = COPY $sgpr0
59 %1:sreg_32 = COPY $sgpr1
60 %inlinable:sreg_32 = S_MOV_B32 1056964608
61 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %1, %inlinable, implicit $mode
65 name: fmac_fold_noninlinable_src0_to_fmamk
66 tracksRegLiveness: true
69 liveins: $sgpr0, $sgpr1
71 ; CHECK-LABEL: name: fmac_fold_noninlinable_src0_to_fmamk
72 ; CHECK: liveins: $sgpr0, $sgpr1
74 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
75 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
76 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAMK_F32 [[COPY]], 1234567890, [[COPY1]], implicit $mode
77 ; CHECK-NEXT: $sgpr0 = COPY %fma
78 %0:sreg_32 = COPY $sgpr0
79 %1:sreg_32 = COPY $sgpr1
80 %noninlinable:sreg_32 = S_MOV_B32 1234567890
81 %fma:sreg_32 = nofpexcept S_FMAC_F32 %noninlinable, %0, %1, implicit $mode
85 name: fmac_fold_noninlinable_src1_to_fmamk
86 tracksRegLiveness: true
89 liveins: $sgpr0, $sgpr1
91 ; CHECK-LABEL: name: fmac_fold_noninlinable_src1_to_fmamk
92 ; CHECK: liveins: $sgpr0, $sgpr1
94 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
95 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
96 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAMK_F32 [[COPY]], 1234567890, [[COPY1]], implicit $mode
97 ; CHECK-NEXT: $sgpr0 = COPY %fma
98 %0:sreg_32 = COPY $sgpr0
99 %1:sreg_32 = COPY $sgpr1
100 %noninlinable:sreg_32 = S_MOV_B32 1234567890
101 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %noninlinable, %1, implicit $mode
105 name: fmac_fold_noninlinable_src2_to_fmaak
106 tracksRegLiveness: true
109 liveins: $sgpr0, $sgpr1
111 ; CHECK-LABEL: name: fmac_fold_noninlinable_src2_to_fmaak
112 ; CHECK: liveins: $sgpr0, $sgpr1
114 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
115 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr1
116 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAAK_F32 [[COPY]], [[COPY1]], 1234567890, implicit $mode
117 ; CHECK-NEXT: $sgpr0 = COPY %fma
118 %0:sreg_32 = COPY $sgpr0
119 %1:sreg_32 = COPY $sgpr1
120 %noninlinable:sreg_32 = S_MOV_B32 1234567890
121 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %1, %noninlinable, implicit $mode
126 name: fmac_fold_inlinable_src2_to_fmaak_noninlinable_src0_to_fmamk
127 tracksRegLiveness: true
132 ; CHECK-LABEL: name: fmac_fold_inlinable_src2_to_fmaak_noninlinable_src0_to_fmamk
133 ; CHECK: liveins: $sgpr0
135 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
136 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAMK_F32 [[COPY]], 1234567890, 1056964608, implicit $mode
137 ; CHECK-NEXT: $sgpr0 = COPY %fma
138 %0:sreg_32 = COPY $sgpr0
139 %inlinable:sreg_32 = S_MOV_B32 1056964608
140 %noninlinable:sreg_32 = S_MOV_B32 1234567890
141 %fma:sreg_32 = nofpexcept S_FMAC_F32 %noninlinable, %0, %inlinable, implicit $mode
145 name: fmac_fold_inlinable_src2_to_fmaak_noninlinable_src1_to_fmamk
146 tracksRegLiveness: true
151 ; CHECK-LABEL: name: fmac_fold_inlinable_src2_to_fmaak_noninlinable_src1_to_fmamk
152 ; CHECK: liveins: $sgpr0
154 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
155 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAMK_F32 [[COPY]], 1234567890, 1056964608, implicit $mode
156 ; CHECK-NEXT: $sgpr0 = COPY %fma
157 %0:sreg_32 = COPY $sgpr0
158 %inlinable:sreg_32 = S_MOV_B32 1056964608
159 %noninlinable:sreg_32 = S_MOV_B32 1234567890
160 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %noninlinable, %inlinable, implicit $mode
164 name: fmac_fold_noninlinable_src2_to_fmaak_inlinable_src1
165 tracksRegLiveness: true
170 ; CHECK-LABEL: name: fmac_fold_noninlinable_src2_to_fmaak_inlinable_src1
171 ; CHECK: liveins: $sgpr0
173 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
174 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAAK_F32 [[COPY]], 1056964608, 1234567890, implicit $mode
175 ; CHECK-NEXT: $sgpr0 = COPY %fma
176 %0:sreg_32 = COPY $sgpr0
177 %noninlinable:sreg_32 = S_MOV_B32 1234567890
178 %inlinable:sreg_32 = S_MOV_B32 1056964608
179 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %inlinable, %noninlinable, implicit $mode
183 name: fmac_fold_noninlinable_src2_to_fmaak_dont_fold_other_noninlinable
184 tracksRegLiveness: true
189 ; CHECK-LABEL: name: fmac_fold_noninlinable_src2_to_fmaak_dont_fold_other_noninlinable
190 ; CHECK: liveins: $sgpr0
192 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
193 ; CHECK-NEXT: %noninlinable2:sreg_32 = S_MOV_B32 1234567891
194 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAAK_F32 [[COPY]], %noninlinable2, 1234567890, implicit $mode
195 ; CHECK-NEXT: $sgpr0 = COPY %fma
196 %0:sreg_32 = COPY $sgpr0
197 %noninlinable:sreg_32 = S_MOV_B32 1234567890
198 %noninlinable2:sreg_32 = S_MOV_B32 1234567891
199 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %noninlinable2, %noninlinable, implicit $mode
203 name: fmac_fold_inlinable_src1_to_fmamk_noninlinable_src2_to_fmaak
204 tracksRegLiveness: true
209 ; CHECK-LABEL: name: fmac_fold_inlinable_src1_to_fmamk_noninlinable_src2_to_fmaak
210 ; CHECK: liveins: $sgpr0
212 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
213 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAAK_F32 [[COPY]], 1056964608, 1234567890, implicit $mode
214 ; CHECK-NEXT: $sgpr0 = COPY %fma
215 %0:sreg_32 = COPY $sgpr0
216 %inlinable:sreg_32 = S_MOV_B32 1056964608
217 %noninlinable:sreg_32 = S_MOV_B32 1234567890
218 %fma:sreg_32 = nofpexcept S_FMAC_F32 %0, %inlinable, %noninlinable, implicit $mode
222 name: fmac_fold_same_noninlinable_src0_and_src1_to_fmamk
223 tracksRegLiveness: true
228 ; CHECK-LABEL: name: fmac_fold_same_noninlinable_src0_and_src1_to_fmamk
229 ; CHECK: liveins: $sgpr0
231 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
232 ; CHECK-NEXT: %fma:sreg_32 = nofpexcept S_FMAMK_F32 1234567890, 1234567890, [[COPY]], implicit $mode
233 ; CHECK-NEXT: $sgpr0 = COPY %fma
234 %0:sreg_32 = COPY $sgpr0
235 %noninlinable:sreg_32 = S_MOV_B32 1234567890
236 %fma:sreg_32 = nofpexcept S_FMAC_F32 %noninlinable, %noninlinable, %0, implicit $mode