1 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
3 define <2 x float> @fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
5 ; CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
6 %tmp1 = fmul contract <2 x float> %A, %B;
7 %tmp2 = fadd contract <2 x float> %C, %tmp1;
11 ; This case will fold as it was only available through unsafe before, now available from
12 ; the contract on the fadd
13 define <2 x float> @fma_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
15 ; CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
16 %tmp1 = fmul <2 x float> %A, %B;
17 %tmp2 = fadd contract <2 x float> %C, %tmp1;
21 define <2 x float> @no_fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
22 ; CHECK-LABEL: no_fma_1:
25 %tmp1 = fmul contract <2 x float> %A, %B;
26 %tmp2 = fadd <2 x float> %C, %tmp1;
30 define <2 x float> @fma_sub_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
31 ; CHECK-LABEL: fma_sub_1:
32 ; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
33 %tmp1 = fmul contract <2 x float> %A, %B;
34 %tmp2 = fsub contract <2 x float> %C, %tmp1;
38 ; This case will fold as it was only available through unsafe before, now available from
39 ; the contract on the fsub
40 define <2 x float> @fma_sub_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
41 ; CHECK-LABEL: fma_sub_2:
42 ; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
43 %tmp1 = fmul <2 x float> %A, %B;
44 %tmp2 = fsub contract <2 x float> %C, %tmp1;
48 define <2 x float> @no_fma_sub_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
49 ; CHECK-LABEL: no_fma_sub_1:
52 %tmp1 = fmul contract <2 x float> %A, %B;
53 %tmp2 = fsub <2 x float> %C, %tmp1;