[llvm] r334461 - NFC, some additional tests added and some renaming for planned fma support changes
Michael Berg via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 11 17:52:43 PDT 2018
Author: mcberg2017
Date: Mon Jun 11 17:52:43 2018
New Revision: 334461
URL: http://llvm.org/viewvc/llvm-project?rev=334461&view=rev
Log:
NFC, some additional tests added and some renaming for planned fma support changes
Modified:
llvm/trunk/test/CodeGen/AArch64/neon-fma-FMF.ll
Modified: llvm/trunk/test/CodeGen/AArch64/neon-fma-FMF.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/neon-fma-FMF.ll?rev=334461&r1=334460&r2=334461&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/neon-fma-FMF.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/neon-fma-FMF.ll Mon Jun 11 17:52:43 2018
@@ -1,13 +1,24 @@
; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
-define <2 x float> @fma(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
-; CHECK-LABEL: fma:
+define <2 x float> @fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
+; CHECK-LABEL: fma_1:
; CHECK: fmla {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
%tmp1 = fmul contract <2 x float> %A, %B;
%tmp2 = fadd contract <2 x float> %C, %tmp1;
ret <2 x float> %tmp2
}
+; This case will fold as it was only available through unsafe before, now available from
+; the contract on the fadd
+define <2 x float> @fma_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
+; CHECK-LABEL: fma_2:
+; CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+; CHECK: fadd {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+ %tmp1 = fmul <2 x float> %A, %B;
+ %tmp2 = fadd contract <2 x float> %C, %tmp1;
+ ret <2 x float> %tmp2
+}
+
define <2 x float> @no_fma_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
; CHECK-LABEL: no_fma_1:
; CHECK: fmul
@@ -17,19 +28,21 @@ define <2 x float> @no_fma_1(<2 x float>
ret <2 x float> %tmp2
}
-define <2 x float> @no_fma_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
-; CHECK-LABEL: no_fma_2:
-; CHECK: fmul
-; CHECK: fadd
- %tmp1 = fmul <2 x float> %A, %B;
- %tmp2 = fadd contract <2 x float> %C, %tmp1;
+define <2 x float> @fma_sub_1(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
+; CHECK-LABEL: fma_sub_1:
+; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+ %tmp1 = fmul contract <2 x float> %A, %B;
+ %tmp2 = fsub contract <2 x float> %C, %tmp1;
ret <2 x float> %tmp2
}
-define <2 x float> @fma_sub(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
-; CHECK-LABEL: fma_sub:
-; CHECK: fmls {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
- %tmp1 = fmul contract <2 x float> %A, %B;
+; This case will fold as it was only available through unsafe before, now available from
+; the contract on the fsub
+define <2 x float> @fma_sub_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
+; CHECK-LABEL: fma_sub_2:
+; CHECK: fmul {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+; CHECK: fsub {{v[0-9]+}}.2s, {{v[0-9]+}}.2s, {{v[0-9]+}}.2s
+ %tmp1 = fmul <2 x float> %A, %B;
%tmp2 = fsub contract <2 x float> %C, %tmp1;
ret <2 x float> %tmp2
}
@@ -42,12 +55,3 @@ define <2 x float> @no_fma_sub_1(<2 x fl
%tmp2 = fsub <2 x float> %C, %tmp1;
ret <2 x float> %tmp2
}
-
-define <2 x float> @no_fma_sub_2(<2 x float> %A, <2 x float> %B, <2 x float> %C) {
-; CHECK-LABEL: no_fma_sub_2:
-; CHECK: fmul
-; CHECK: fsub
- %tmp1 = fmul <2 x float> %A, %B;
- %tmp2 = fsub contract <2 x float> %C, %tmp1;
- ret <2 x float> %tmp2
-}
More information about the llvm-commits
mailing list