summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvandro Menezes <e.menezes@samsung.com>2016-09-20 19:02:02 +0000
committerEvandro Menezes <e.menezes@samsung.com>2016-09-20 19:02:02 +0000
commit61a1273d27f3a35cd306f41cb3dcc8575470b8e4 (patch)
tree106d6fb55aa925b97d6ae810a119f8b06b21e80d
parente848a7363f092f70ecd1bf0646c06b9c0f4344de (diff)
downloadbcm5719-llvm-61a1273d27f3a35cd306f41cb3dcc8575470b8e4.tar.gz
bcm5719-llvm-61a1273d27f3a35cd306f41cb3dcc8575470b8e4.zip
Revert "[AArch64] Properly validate the reciprocal estimation."
This reverts commit ad8ca1528242e2a4cb363e3779309e70eb7a430e per request by Eric Christopher <echristo@gmail.com> (v. http://bit.ly/2cmz6kW). llvm-svn: 281999
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelLowering.cpp6
-rw-r--r--llvm/test/CodeGen/AArch64/recp-fastmath.ll34
-rw-r--r--llvm/test/CodeGen/AArch64/sqrt-fastmath.ll78
3 files changed, 4 insertions, 114 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 7291be33276..1fca58241ed 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -4594,12 +4594,6 @@ static SDValue getEstimate(const AArch64Subtarget &ST,
return SDValue();
EVT VT = Operand.getValueType();
- if (VT != MVT::f64 && VT != MVT::v1f64 && VT != MVT::v2f64 &&
- VT != MVT::f32 && VT != MVT::v1f32 &&
- VT != MVT::v2f32 && VT != MVT::v4f32 &&
- (!ST.hasFullFP16() ||
- (VT != MVT::f16 && VT != MVT::v4f16 && VT != MVT::v8f16)))
- return SDValue();
std::string RecipOp;
RecipOp = Opcode == (AArch64ISD::FRECPE) ? "div": "sqrt";
diff --git a/llvm/test/CodeGen/AArch64/recp-fastmath.ll b/llvm/test/CodeGen/AArch64/recp-fastmath.ll
index 1cecdba96ba..710739b2cc5 100644
--- a/llvm/test/CodeGen/AArch64/recp-fastmath.ll
+++ b/llvm/test/CodeGen/AArch64/recp-fastmath.ll
@@ -46,23 +46,6 @@ define <4 x float> @f4recp(<4 x float> %x) #0 {
; CHECK-NEXT: frecpe
}
-define <8 x float> @f8recp(<8 x float> %x) #0 {
- %div = fdiv fast <8 x float> <float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0>, %x
- ret <8 x float> %div
-
-; FAULT-LABEL: f8recp:
-; FAULT-NEXT: BB#0
-; FAULT-NEXT: fmov
-; FAULT-NEXT: fdiv
-; FAULT-NEXT: fdiv
-
-; CHECK-LABEL: f8recp:
-; CHECK-NEXT: BB#0
-; CHECK-NEXT: fmov
-; CHECK-NEXT: frecpe
-; CHECK: frecpe
-}
-
define double @drecp(double %x) #0 {
%div = fdiv fast double 1.0, %x
ret double %div
@@ -93,21 +76,4 @@ define <2 x double> @d2recp(<2 x double> %x) #0 {
; CHECK-NEXT: frecpe
}
-define <4 x double> @d4recp(<4 x double> %x) #0 {
- %div = fdiv fast <4 x double> <double 1.0, double 1.0, double 1.0, double 1.0>, %x
- ret <4 x double> %div
-
-; FAULT-LABEL: d4recp:
-; FAULT-NEXT: BB#0
-; FAULT-NEXT: fmov
-; FAULT-NEXT: fdiv
-; FAULT-NEXT: fdiv
-
-; CHECK-LABEL: d4recp:
-; CHECK-NEXT: BB#0
-; CHECK-NEXT: fmov
-; CHECK-NEXT: frecpe
-; CHECK: frecpe
-}
-
attributes #0 = { nounwind "unsafe-fp-math"="true" }
diff --git a/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll b/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
index 962c7d80a65..0d9533fd27f 100644
--- a/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
+++ b/llvm/test/CodeGen/AArch64/sqrt-fastmath.ll
@@ -1,15 +1,13 @@
-; RUN: llc < %s -mtriple=aarch64 -mattr=neon -recip=!sqrt,!vec-sqrt | FileCheck %s --check-prefix=FAULT
-; RUN: llc < %s -mtriple=aarch64 -mattr=neon,-use-reverse-square-root | FileCheck %s --check-prefix=FAULT
-; RUN: llc < %s -mtriple=aarch64 -mattr=neon -recip=sqrt,vec-sqrt | FileCheck %s
+; RUN: llc < %s -mtriple=aarch64 -mattr=neon -recip=!sqrt,!vec-sqrt | FileCheck %s --check-prefix=FAULT
+; RUN: llc < %s -mtriple=aarch64 -mattr=neon -recip=sqrt,vec-sqrt | FileCheck %s
+; RUN: llc < %s -mtriple=aarch64 -mattr=neon,-use-reverse-square-root | FileCheck %s --check-prefix=FAULT
; RUN: llc < %s -mtriple=aarch64 -mattr=neon,+use-reverse-square-root | FileCheck %s
declare float @llvm.sqrt.f32(float) #1
+declare double @llvm.sqrt.f64(double) #1
declare <2 x float> @llvm.sqrt.v2f32(<2 x float>) #1
declare <4 x float> @llvm.sqrt.v4f32(<4 x float>) #1
-declare <8 x float> @llvm.sqrt.v8f32(<8 x float>) #1
-declare double @llvm.sqrt.f64(double) #1
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #1
-declare <4 x double> @llvm.sqrt.v4f64(<4 x double>) #1
define float @fsqrt(float %a) #0 {
%1 = tail call fast float @llvm.sqrt.f32(float %a)
@@ -55,23 +53,6 @@ define <4 x float> @f4sqrt(<4 x float> %a) #0 {
; CHECK-NEXT: frsqrte
}
-define <8 x float> @f8sqrt(<8 x float> %a) #0 {
- %1 = tail call fast <8 x float> @llvm.sqrt.v8f32(<8 x float> %a) #2
- ret <8 x float> %1
-
-; FAULT-LABEL: f8sqrt:
-; FAULT-NEXT: BB#0
-; FAULT-NEXT: fsqrt
-; FAULT-NEXT: fsqrt
-
-; CHECK-LABEL: f8sqrt:
-; CHECK-NEXT: BB#0
-; CHECK-NEXT: fmov
-; CHECK-NEXT: mov
-; CHECK-NEXT: frsqrte
-; CHECK: frsqrte
-}
-
define double @dsqrt(double %a) #0 {
%1 = tail call fast double @llvm.sqrt.f64(double %a)
ret double %1
@@ -101,23 +82,6 @@ define <2 x double> @d2sqrt(<2 x double> %a) #0 {
; CHECK-NEXT: frsqrte
}
-define <4 x double> @d4sqrt(<4 x double> %a) #0 {
- %1 = tail call fast <4 x double> @llvm.sqrt.v4f64(<4 x double> %a) #4
- ret <4 x double> %1
-
-; FAULT-LABEL: d4sqrt:
-; FAULT-NEXT: BB#0
-; FAULT-NEXT: fsqrt
-; FAULT-NEXT: fsqrt
-
-; CHECK-LABEL: d4sqrt:
-; CHECK-NEXT: BB#0
-; CHECK-NEXT: fmov
-; CHECK-NEXT: mov
-; CHECK-NEXT: frsqrte
-; CHECK: frsqrte
-}
-
define float @frsqrt(float %a) #0 {
%1 = tail call fast float @llvm.sqrt.f32(float %a)
%2 = fdiv fast float 1.000000e+00, %1
@@ -163,23 +127,6 @@ define <4 x float> @f4rsqrt(<4 x float> %a) #0 {
; CHECK-NEXT: frsqrte
}
-define <8 x float> @f8rsqrt(<8 x float> %a) #0 {
- %1 = tail call fast <8 x float> @llvm.sqrt.v8f32(<8 x float> %a) #2
- %2 = fdiv fast <8 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, %1
- ret <8 x float> %2
-
-; FAULT-LABEL: f8rsqrt:
-; FAULT-NEXT: BB#0
-; FAULT-NEXT: fsqrt
-; FAULT-NEXT: fsqrt
-
-; CHECK-LABEL: f8rsqrt:
-; CHECK-NEXT: BB#0
-; CHECK-NEXT: fmov
-; CHECK-NEXT: frsqrte
-; CHECK: frsqrte
-}
-
define double @drsqrt(double %a) #0 {
%1 = tail call fast double @llvm.sqrt.f64(double %a)
%2 = fdiv fast double 1.000000e+00, %1
@@ -210,21 +157,4 @@ define <2 x double> @d2rsqrt(<2 x double> %a) #0 {
; CHECK-NEXT: frsqrte
}
-define <4 x double> @d4rsqrt(<4 x double> %a) #0 {
- %1 = tail call fast <4 x double> @llvm.sqrt.v4f64(<4 x double> %a) #4
- %2 = fdiv fast <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>, %1
- ret <4 x double> %2
-
-; FAULT-LABEL: d4rsqrt:
-; FAULT-NEXT: BB#0
-; FAULT-NEXT: fsqrt
-; FAULT-NEXT: fsqrt
-
-; CHECK-LABEL: d4rsqrt:
-; CHECK-NEXT: BB#0
-; CHECK-NEXT: fmov
-; CHECK-NEXT: frsqrte
-; CHECK: frsqrte
-}
-
attributes #0 = { nounwind "unsafe-fp-math"="true" }
OpenPOWER on IntegriCloud