1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -instcombine < %s | FileCheck %s
4 declare float @llvm.fma.f32(float, float, float) #1
5 declare <2 x float> @llvm.fma.v2f32(<2 x float>, <2 x float>, <2 x float>) #1
6 declare float @llvm.fmuladd.f32(float, float, float) #1
7 declare float @llvm.fabs.f32(float) #1
9 @external = external global i32
11 define float @fma_fneg_x_fneg_y(float %x, float %y, float %z) {
12 ; CHECK-LABEL: @fma_fneg_x_fneg_y(
13 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])
14 ; CHECK-NEXT: ret float [[FMA]]
16 %x.fneg = fsub float -0.0, %x
17 %y.fneg = fsub float -0.0, %y
18 %fma = call float @llvm.fma.f32(float %x.fneg, float %y.fneg, float %z)
22 define float @fma_unary_fneg_x_unary_fneg_y(float %x, float %y, float %z) {
23 ; CHECK-LABEL: @fma_unary_fneg_x_unary_fneg_y(
24 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])
25 ; CHECK-NEXT: ret float [[FMA]]
27 %x.fneg = fneg float %x
28 %y.fneg = fneg float %y
29 %fma = call float @llvm.fma.f32(float %x.fneg, float %y.fneg, float %z)
33 define <2 x float> @fma_fneg_x_fneg_y_vec(<2 x float> %x, <2 x float> %y, <2 x float> %z) {
34 ; CHECK-LABEL: @fma_fneg_x_fneg_y_vec(
35 ; CHECK-NEXT: [[FMA:%.*]] = call <2 x float> @llvm.fma.v2f32(<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]], <2 x float> [[Z:%.*]])
36 ; CHECK-NEXT: ret <2 x float> [[FMA]]
38 %xn = fsub <2 x float> <float -0.0, float -0.0>, %x
39 %yn = fsub <2 x float> <float -0.0, float -0.0>, %y
40 %fma = call <2 x float> @llvm.fma.v2f32(<2 x float> %xn, <2 x float> %yn, <2 x float> %z)
44 define <2 x float> @fma_unary_fneg_x_unary_fneg_y_vec(<2 x float> %x, <2 x float> %y, <2 x float> %z) {
45 ; CHECK-LABEL: @fma_unary_fneg_x_unary_fneg_y_vec(
46 ; CHECK-NEXT: [[FMA:%.*]] = call <2 x float> @llvm.fma.v2f32(<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]], <2 x float> [[Z:%.*]])
47 ; CHECK-NEXT: ret <2 x float> [[FMA]]
49 %xn = fneg <2 x float> %x
50 %yn = fneg <2 x float> %y
51 %fma = call <2 x float> @llvm.fma.v2f32(<2 x float> %xn, <2 x float> %yn, <2 x float> %z)
55 define <2 x float> @fma_fneg_x_fneg_y_vec_undef(<2 x float> %x, <2 x float> %y, <2 x float> %z) {
56 ; CHECK-LABEL: @fma_fneg_x_fneg_y_vec_undef(
57 ; CHECK-NEXT: [[FMA:%.*]] = call <2 x float> @llvm.fma.v2f32(<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]], <2 x float> [[Z:%.*]])
58 ; CHECK-NEXT: ret <2 x float> [[FMA]]
60 %xn = fsub <2 x float> <float -0.0, float undef>, %x
61 %yn = fsub <2 x float> <float undef, float -0.0>, %y
62 %fma = call <2 x float> @llvm.fma.v2f32(<2 x float> %xn, <2 x float> %yn, <2 x float> %z)
66 define float @fma_fneg_x_fneg_y_fast(float %x, float %y, float %z) {
67 ; CHECK-LABEL: @fma_fneg_x_fneg_y_fast(
68 ; CHECK-NEXT: [[FMA:%.*]] = call fast float @llvm.fma.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])
69 ; CHECK-NEXT: ret float [[FMA]]
71 %x.fneg = fsub float -0.0, %x
72 %y.fneg = fsub float -0.0, %y
73 %fma = call fast float @llvm.fma.f32(float %x.fneg, float %y.fneg, float %z)
77 define float @fma_unary_fneg_x_unary_fneg_y_fast(float %x, float %y, float %z) {
78 ; CHECK-LABEL: @fma_unary_fneg_x_unary_fneg_y_fast(
79 ; CHECK-NEXT: [[FMA:%.*]] = call fast float @llvm.fma.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])
80 ; CHECK-NEXT: ret float [[FMA]]
82 %x.fneg = fneg float %x
83 %y.fneg = fneg float %y
84 %fma = call fast float @llvm.fma.f32(float %x.fneg, float %y.fneg, float %z)
88 define float @fma_fneg_const_fneg_y(float %y, float %z) {
89 ; CHECK-LABEL: @fma_fneg_const_fneg_y(
90 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[Y:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
91 ; CHECK-NEXT: ret float [[FMA]]
93 %y.fneg = fsub float -0.0, %y
94 %fma = call float @llvm.fma.f32(float fsub (float -0.0, float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %y.fneg, float %z)
98 define float @fma_unary_fneg_const_unary_fneg_y(float %y, float %z) {
99 ; CHECK-LABEL: @fma_unary_fneg_const_unary_fneg_y(
100 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[Y:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
101 ; CHECK-NEXT: ret float [[FMA]]
103 %y.fneg = fneg float %y
104 %fma = call float @llvm.fma.f32(float fneg (float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %y.fneg, float %z)
108 define float @fma_fneg_x_fneg_const(float %x, float %z) {
109 ; CHECK-LABEL: @fma_fneg_x_fneg_const(
110 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[X:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
111 ; CHECK-NEXT: ret float [[FMA]]
113 %x.fneg = fsub float -0.0, %x
114 %fma = call float @llvm.fma.f32(float %x.fneg, float fsub (float -0.0, float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %z)
118 define float @fma_unary_fneg_x_unary_fneg_const(float %x, float %z) {
119 ; CHECK-LABEL: @fma_unary_fneg_x_unary_fneg_const(
120 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[X:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
121 ; CHECK-NEXT: ret float [[FMA]]
123 %x.fneg = fneg float %x
124 %fma = call float @llvm.fma.f32(float %x.fneg, float fneg (float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %z)
128 define float @fma_fabs_x_fabs_y(float %x, float %y, float %z) {
129 ; CHECK-LABEL: @fma_fabs_x_fabs_y(
130 ; CHECK-NEXT: [[X_FABS:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
131 ; CHECK-NEXT: [[Y_FABS:%.*]] = call float @llvm.fabs.f32(float [[Y:%.*]])
132 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[X_FABS]], float [[Y_FABS]], float [[Z:%.*]])
133 ; CHECK-NEXT: ret float [[FMA]]
135 %x.fabs = call float @llvm.fabs.f32(float %x)
136 %y.fabs = call float @llvm.fabs.f32(float %y)
137 %fma = call float @llvm.fma.f32(float %x.fabs, float %y.fabs, float %z)
141 define float @fma_fabs_x_fabs_x(float %x, float %z) {
142 ; CHECK-LABEL: @fma_fabs_x_fabs_x(
143 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[X:%.*]], float [[X]], float [[Z:%.*]])
144 ; CHECK-NEXT: ret float [[FMA]]
146 %x.fabs = call float @llvm.fabs.f32(float %x)
147 %fma = call float @llvm.fma.f32(float %x.fabs, float %x.fabs, float %z)
151 define float @fma_fabs_x_fabs_x_fast(float %x, float %z) {
152 ; CHECK-LABEL: @fma_fabs_x_fabs_x_fast(
153 ; CHECK-NEXT: [[FMA:%.*]] = call fast float @llvm.fma.f32(float [[X:%.*]], float [[X]], float [[Z:%.*]])
154 ; CHECK-NEXT: ret float [[FMA]]
156 %x.fabs = call float @llvm.fabs.f32(float %x)
157 %fma = call fast float @llvm.fma.f32(float %x.fabs, float %x.fabs, float %z)
161 define float @fmuladd_fneg_x_fneg_y(float %x, float %y, float %z) {
162 ; CHECK-LABEL: @fmuladd_fneg_x_fneg_y(
163 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])
164 ; CHECK-NEXT: ret float [[FMULADD]]
166 %x.fneg = fsub float -0.0, %x
167 %y.fneg = fsub float -0.0, %y
168 %fmuladd = call float @llvm.fmuladd.f32(float %x.fneg, float %y.fneg, float %z)
172 define float @fmuladd_unary_fneg_x_unary_fneg_y(float %x, float %y, float %z) {
173 ; CHECK-LABEL: @fmuladd_unary_fneg_x_unary_fneg_y(
174 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])
175 ; CHECK-NEXT: ret float [[FMULADD]]
177 %x.fneg = fneg float %x
178 %y.fneg = fneg float %y
179 %fmuladd = call float @llvm.fmuladd.f32(float %x.fneg, float %y.fneg, float %z)
183 define float @fmuladd_fneg_x_fneg_y_fast(float %x, float %y, float %z) {
184 ; CHECK-LABEL: @fmuladd_fneg_x_fneg_y_fast(
185 ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[X:%.*]], [[Y:%.*]]
186 ; CHECK-NEXT: [[FMULADD:%.*]] = fadd fast float [[TMP1]], [[Z:%.*]]
187 ; CHECK-NEXT: ret float [[FMULADD]]
189 %x.fneg = fsub float -0.0, %x
190 %y.fneg = fsub float -0.0, %y
191 %fmuladd = call fast float @llvm.fmuladd.f32(float %x.fneg, float %y.fneg, float %z)
195 define float @fmuladd_unary_fneg_x_unary_fneg_y_fast(float %x, float %y, float %z) {
196 ; CHECK-LABEL: @fmuladd_unary_fneg_x_unary_fneg_y_fast(
197 ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[X:%.*]], [[Y:%.*]]
198 ; CHECK-NEXT: [[FMULADD:%.*]] = fadd fast float [[TMP1]], [[Z:%.*]]
199 ; CHECK-NEXT: ret float [[FMULADD]]
201 %x.fneg = fneg float %x
202 %y.fneg = fneg float %y
203 %fmuladd = call fast float @llvm.fmuladd.f32(float %x.fneg, float %y.fneg, float %z)
207 define float @fmuladd_fneg_const_fneg_y(float %y, float %z) {
208 ; CHECK-LABEL: @fmuladd_fneg_const_fneg_y(
209 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[Y:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
210 ; CHECK-NEXT: ret float [[FMULADD]]
212 %y.fneg = fsub float -0.0, %y
213 %fmuladd = call float @llvm.fmuladd.f32(float fsub (float -0.0, float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %y.fneg, float %z)
217 define float @fmuladd_unary_fneg_const_unary_fneg_y(float %y, float %z) {
218 ; CHECK-LABEL: @fmuladd_unary_fneg_const_unary_fneg_y(
219 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[Y:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
220 ; CHECK-NEXT: ret float [[FMULADD]]
222 %y.fneg = fneg float %y
223 %fmuladd = call float @llvm.fmuladd.f32(float fneg (float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %y.fneg, float %z)
227 define float @fmuladd_fneg_x_fneg_const(float %x, float %z) {
228 ; CHECK-LABEL: @fmuladd_fneg_x_fneg_const(
229 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[X:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
230 ; CHECK-NEXT: ret float [[FMULADD]]
232 %x.fneg = fsub float -0.0, %x
233 %fmuladd = call float @llvm.fmuladd.f32(float %x.fneg, float fsub (float -0.0, float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %z)
237 define float @fmuladd_unary_fneg_x_unary_fneg_const(float %x, float %z) {
238 ; CHECK-LABEL: @fmuladd_unary_fneg_x_unary_fneg_const(
239 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[X:%.*]], float bitcast (i32 ptrtoint (i32* @external to i32) to float), float [[Z:%.*]])
240 ; CHECK-NEXT: ret float [[FMULADD]]
242 %x.fneg = fneg float %x
243 %fmuladd = call float @llvm.fmuladd.f32(float %x.fneg, float fneg (float bitcast (i32 ptrtoint (i32* @external to i32) to float)), float %z)
247 define float @fmuladd_fabs_x_fabs_y(float %x, float %y, float %z) {
248 ; CHECK-LABEL: @fmuladd_fabs_x_fabs_y(
249 ; CHECK-NEXT: [[X_FABS:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
250 ; CHECK-NEXT: [[Y_FABS:%.*]] = call float @llvm.fabs.f32(float [[Y:%.*]])
251 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[X_FABS]], float [[Y_FABS]], float [[Z:%.*]])
252 ; CHECK-NEXT: ret float [[FMULADD]]
254 %x.fabs = call float @llvm.fabs.f32(float %x)
255 %y.fabs = call float @llvm.fabs.f32(float %y)
256 %fmuladd = call float @llvm.fmuladd.f32(float %x.fabs, float %y.fabs, float %z)
260 define float @fmuladd_fabs_x_fabs_x(float %x, float %z) {
261 ; CHECK-LABEL: @fmuladd_fabs_x_fabs_x(
262 ; CHECK-NEXT: [[FMULADD:%.*]] = call float @llvm.fmuladd.f32(float [[X:%.*]], float [[X]], float [[Z:%.*]])
263 ; CHECK-NEXT: ret float [[FMULADD]]
265 %x.fabs = call float @llvm.fabs.f32(float %x)
266 %fmuladd = call float @llvm.fmuladd.f32(float %x.fabs, float %x.fabs, float %z)
270 define float @fmuladd_fabs_x_fabs_x_fast(float %x, float %z) {
271 ; CHECK-LABEL: @fmuladd_fabs_x_fabs_x_fast(
272 ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[X:%.*]], [[X]]
273 ; CHECK-NEXT: [[FMULADD:%.*]] = fadd fast float [[TMP1]], [[Z:%.*]]
274 ; CHECK-NEXT: ret float [[FMULADD]]
276 %x.fabs = call float @llvm.fabs.f32(float %x)
277 %fmuladd = call fast float @llvm.fmuladd.f32(float %x.fabs, float %x.fabs, float %z)
281 define float @fma_k_y_z(float %y, float %z) {
282 ; CHECK-LABEL: @fma_k_y_z(
283 ; CHECK-NEXT: [[FMA:%.*]] = call float @llvm.fma.f32(float [[Y:%.*]], float 4.000000e+00, float [[Z:%.*]])
284 ; CHECK-NEXT: ret float [[FMA]]
286 %fma = call float @llvm.fma.f32(float 4.0, float %y, float %z)
290 define float @fma_k_y_z_fast(float %y, float %z) {
291 ; CHECK-LABEL: @fma_k_y_z_fast(
292 ; CHECK-NEXT: [[FMA:%.*]] = call fast float @llvm.fma.f32(float [[Y:%.*]], float 4.000000e+00, float [[Z:%.*]])
293 ; CHECK-NEXT: ret float [[FMA]]
295 %fma = call fast float @llvm.fma.f32(float 4.0, float %y, float %z)
299 define float @fmuladd_k_y_z_fast(float %y, float %z) {
300 ; CHECK-LABEL: @fmuladd_k_y_z_fast(
301 ; CHECK-NEXT: [[TMP1:%.*]] = fmul fast float [[Y:%.*]], 4.000000e+00
302 ; CHECK-NEXT: [[FMULADD:%.*]] = fadd fast float [[TMP1]], [[Z:%.*]]
303 ; CHECK-NEXT: ret float [[FMULADD]]
305 %fmuladd = call fast float @llvm.fmuladd.f32(float 4.0, float %y, float %z)
309 define float @fma_1_y_z(float %y, float %z) {
310 ; CHECK-LABEL: @fma_1_y_z(
311 ; CHECK-NEXT: [[FMA:%.*]] = fadd float [[Y:%.*]], [[Z:%.*]]
312 ; CHECK-NEXT: ret float [[FMA]]
314 %fma = call float @llvm.fma.f32(float 1.0, float %y, float %z)
318 define float @fma_x_1_z(float %x, float %z) {
319 ; CHECK-LABEL: @fma_x_1_z(
320 ; CHECK-NEXT: [[FMA:%.*]] = fadd float [[X:%.*]], [[Z:%.*]]
321 ; CHECK-NEXT: ret float [[FMA]]
323 %fma = call float @llvm.fma.f32(float %x, float 1.0, float %z)
327 define <2 x float> @fma_x_1_z_v2f32(<2 x float> %x, <2 x float> %z) {
328 ; CHECK-LABEL: @fma_x_1_z_v2f32(
329 ; CHECK-NEXT: [[FMA:%.*]] = fadd <2 x float> [[X:%.*]], [[Z:%.*]]
330 ; CHECK-NEXT: ret <2 x float> [[FMA]]
332 %fma = call <2 x float> @llvm.fma.v2f32(<2 x float> %x, <2 x float> <float 1.0, float 1.0>, <2 x float> %z)
336 define <2 x float> @fma_x_1_2_z_v2f32(<2 x float> %x, <2 x float> %z) {
337 ; CHECK-LABEL: @fma_x_1_2_z_v2f32(
338 ; CHECK-NEXT: [[FMA:%.*]] = call <2 x float> @llvm.fma.v2f32(<2 x float> [[X:%.*]], <2 x float> <float 1.000000e+00, float 2.000000e+00>, <2 x float> [[Z:%.*]])
339 ; CHECK-NEXT: ret <2 x float> [[FMA]]
341 %fma = call <2 x float> @llvm.fma.v2f32(<2 x float> %x, <2 x float> <float 1.0, float 2.0>, <2 x float> %z)
345 define float @fma_x_1_z_fast(float %x, float %z) {
346 ; CHECK-LABEL: @fma_x_1_z_fast(
347 ; CHECK-NEXT: [[FMA:%.*]] = fadd fast float [[X:%.*]], [[Z:%.*]]
348 ; CHECK-NEXT: ret float [[FMA]]
350 %fma = call fast float @llvm.fma.f32(float %x, float 1.0, float %z)
354 define float @fma_1_1_z(float %z) {
355 ; CHECK-LABEL: @fma_1_1_z(
356 ; CHECK-NEXT: [[FMA:%.*]] = fadd float [[Z:%.*]], 1.000000e+00
357 ; CHECK-NEXT: ret float [[FMA]]
359 %fma = call float @llvm.fma.f32(float 1.0, float 1.0, float %z)
363 define float @fmuladd_x_1_z_fast(float %x, float %z) {
364 ; CHECK-LABEL: @fmuladd_x_1_z_fast(
365 ; CHECK-NEXT: [[FMULADD:%.*]] = fadd fast float [[X:%.*]], [[Z:%.*]]
366 ; CHECK-NEXT: ret float [[FMULADD]]
368 %fmuladd = call fast float @llvm.fmuladd.f32(float %x, float 1.0, float %z)
372 define <2 x double> @fmuladd_a_0_b(<2 x double> %a, <2 x double> %b) {
373 ; CHECK-LABEL: @fmuladd_a_0_b(
375 ; CHECK-NEXT: [[RES:%.*]] = call nnan nsz <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[A:%.*]], <2 x double> zeroinitializer, <2 x double> [[B:%.*]])
376 ; CHECK-NEXT: ret <2 x double> [[RES]]
379 %res = call nnan nsz <2 x double> @llvm.fmuladd.v2f64(<2 x double> %a, <2 x double> zeroinitializer, <2 x double> %b)
380 ret <2 x double> %res
383 define <2 x double> @fmuladd_0_a_b(<2 x double> %a, <2 x double> %b) {
384 ; CHECK-LABEL: @fmuladd_0_a_b(
386 ; CHECK-NEXT: [[RES:%.*]] = call nnan nsz <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[A:%.*]], <2 x double> zeroinitializer, <2 x double> [[B:%.*]])
387 ; CHECK-NEXT: ret <2 x double> [[RES]]
390 %res = call nnan nsz <2 x double> @llvm.fmuladd.v2f64(<2 x double> zeroinitializer, <2 x double> %a, <2 x double> %b)
391 ret <2 x double> %res
394 define <2 x double> @fmuladd_a_0_b_missing_flags(<2 x double> %a, <2 x double> %b) {
395 ; CHECK-LABEL: @fmuladd_a_0_b_missing_flags(
397 ; CHECK-NEXT: [[RES:%.*]] = call nnan <2 x double> @llvm.fmuladd.v2f64(<2 x double> [[A:%.*]], <2 x double> zeroinitializer, <2 x double> [[B:%.*]])
398 ; CHECK-NEXT: ret <2 x double> [[RES]]
401 %res = call nnan <2 x double> @llvm.fmuladd.v2f64(<2 x double> %a, <2 x double> zeroinitializer, <2 x double> %b)
402 ret <2 x double> %res
405 declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>)
407 define <2 x double> @fma_a_0_b(<2 x double> %a, <2 x double> %b) {
408 ; CHECK-LABEL: @fma_a_0_b(
410 ; CHECK-NEXT: [[RES:%.*]] = call nnan nsz <2 x double> @llvm.fma.v2f64(<2 x double> [[A:%.*]], <2 x double> zeroinitializer, <2 x double> [[B:%.*]])
411 ; CHECK-NEXT: ret <2 x double> [[RES]]
414 %res = call nnan nsz <2 x double> @llvm.fma.v2f64(<2 x double> %a, <2 x double> zeroinitializer, <2 x double> %b)
415 ret <2 x double> %res
418 define <2 x double> @fma_0_a_b(<2 x double> %a, <2 x double> %b) {
419 ; CHECK-LABEL: @fma_0_a_b(
421 ; CHECK-NEXT: [[RES:%.*]] = call nnan nsz <2 x double> @llvm.fma.v2f64(<2 x double> [[A:%.*]], <2 x double> zeroinitializer, <2 x double> [[B:%.*]])
422 ; CHECK-NEXT: ret <2 x double> [[RES]]
425 %res = call nnan nsz <2 x double> @llvm.fma.v2f64(<2 x double> zeroinitializer, <2 x double> %a, <2 x double> %b)
426 ret <2 x double> %res
429 define <2 x double> @fma_0_a_b_missing_flags(<2 x double> %a, <2 x double> %b) {
430 ; CHECK-LABEL: @fma_0_a_b_missing_flags(
432 ; CHECK-NEXT: [[RES:%.*]] = call nsz <2 x double> @llvm.fma.v2f64(<2 x double> [[A:%.*]], <2 x double> zeroinitializer, <2 x double> [[B:%.*]])
433 ; CHECK-NEXT: ret <2 x double> [[RES]]
436 %res = call nsz <2 x double> @llvm.fma.v2f64(<2 x double> zeroinitializer, <2 x double> %a, <2 x double> %b)
437 ret <2 x double> %res
440 define <2 x double> @fma_sqrt(<2 x double> %a, <2 x double> %b) {
441 ; CHECK-LABEL: @fma_sqrt(
443 ; CHECK-NEXT: [[SQRT:%.*]] = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> [[A:%.*]])
444 ; CHECK-NEXT: [[RES:%.*]] = call fast <2 x double> @llvm.fma.v2f64(<2 x double> [[SQRT]], <2 x double> [[SQRT]], <2 x double> [[B:%.*]])
445 ; CHECK-NEXT: ret <2 x double> [[RES]]
448 %sqrt = call fast <2 x double> @llvm.sqrt.v2f64(<2 x double> %a)
449 %res = call fast <2 x double> @llvm.fma.v2f64(<2 x double> %sqrt, <2 x double> %sqrt, <2 x double> %b)
450 ret <2 x double> %res
454 declare <2 x double> @llvm.fma.v2f64(<2 x double>, <2 x double>, <2 x double>)
455 declare <2 x double> @llvm.sqrt.v2f64(<2 x double>)
458 attributes #0 = { nounwind }
459 attributes #1 = { nounwind readnone }