summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-03-15 14:29:27 +0000
committerSanjay Patel <spatel@rotateright.com>2018-03-15 14:29:27 +0000
commita4f42f2cfdf83c6a8e44728614335330a7dd24d2 (patch)
treeee72e76a9286b8aba6e14d52af9d22e85e6c24f3 /llvm/test
parent8f063d0c70dbd3aea79ae16a2d961bb133d2a17d (diff)
downloadbcm5719-llvm-a4f42f2cfdf83c6a8e44728614335330a7dd24d2.tar.gz
bcm5719-llvm-a4f42f2cfdf83c6a8e44728614335330a7dd24d2.zip
[PatternMatch, InstSimplify] allow undef elements when matching any vector FP zero
This matcher implementation appears to be slightly more efficient than the generic constant check that it is replacing because every use was for matching FP patterns, but the previous code would check int and pointer type nulls too. llvm-svn: 327627
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstSimplify/fast-math.ll18
1 files changed, 5 insertions, 13 deletions
diff --git a/llvm/test/Transforms/InstSimplify/fast-math.ll b/llvm/test/Transforms/InstSimplify/fast-math.ll
index bed39fbc836..493d7e1f60e 100644
--- a/llvm/test/Transforms/InstSimplify/fast-math.ll
+++ b/llvm/test/Transforms/InstSimplify/fast-math.ll
@@ -20,8 +20,7 @@ define float @mul_zero_2(float %a) {
define <2 x float> @mul_zero_nsz_nnan_vec_undef(<2 x float> %a) {
; CHECK-LABEL: @mul_zero_nsz_nnan_vec_undef(
-; CHECK-NEXT: [[B:%.*]] = fmul nnan nsz <2 x float> [[A:%.*]], <float 0.000000e+00, float undef>
-; CHECK-NEXT: ret <2 x float> [[B]]
+; CHECK-NEXT: ret <2 x float> zeroinitializer
;
%b = fmul nsz nnan <2 x float> %a, <float 0.0, float undef>
ret <2 x float> %b
@@ -79,9 +78,7 @@ define <2 x float> @fadd_fnegx_commute_vec(<2 x float> %x) {
define <2 x float> @fadd_fnegx_commute_vec_undef(<2 x float> %x) {
; CHECK-LABEL: @fadd_fnegx_commute_vec_undef(
-; CHECK-NEXT: [[NEGX:%.*]] = fsub <2 x float> <float undef, float -0.000000e+00>, [[X:%.*]]
-; CHECK-NEXT: [[R:%.*]] = fadd nnan <2 x float> [[X]], [[NEGX]]
-; CHECK-NEXT: ret <2 x float> [[R]]
+; CHECK-NEXT: ret <2 x float> zeroinitializer
;
%negx = fsub <2 x float> <float undef, float -0.0>, %x
%r = fadd nnan <2 x float> %x, %negx
@@ -181,9 +178,7 @@ define float @fsub_0_0_x(float %a) {
define <2 x float> @fsub_0_0_x_vec_undef1(<2 x float> %a) {
; CHECK-LABEL: @fsub_0_0_x_vec_undef1(
-; CHECK-NEXT: [[T1:%.*]] = fsub <2 x float> <float 0.000000e+00, float undef>, [[A:%.*]]
-; CHECK-NEXT: [[RET:%.*]] = fsub nsz <2 x float> zeroinitializer, [[T1]]
-; CHECK-NEXT: ret <2 x float> [[RET]]
+; CHECK-NEXT: ret <2 x float> [[A:%.*]]
;
%t1 = fsub <2 x float> <float 0.0, float undef>, %a
%ret = fsub nsz <2 x float> zeroinitializer, %t1
@@ -192,9 +187,7 @@ define <2 x float> @fsub_0_0_x_vec_undef1(<2 x float> %a) {
define <2 x float> @fsub_0_0_x_vec_undef2(<2 x float> %a) {
; CHECK-LABEL: @fsub_0_0_x_vec_undef2(
-; CHECK-NEXT: [[T1:%.*]] = fsub <2 x float> zeroinitializer, [[A:%.*]]
-; CHECK-NEXT: [[RET:%.*]] = fsub nsz <2 x float> <float undef, float -0.000000e+00>, [[T1]]
-; CHECK-NEXT: ret <2 x float> [[RET]]
+; CHECK-NEXT: ret <2 x float> [[A:%.*]]
;
%t1 = fsub <2 x float> zeroinitializer, %a
%ret = fsub nsz <2 x float> <float undef, float -0.0>, %t1
@@ -229,8 +222,7 @@ define double @fdiv_zero_by_x(double %x) {
define <2 x double> @fdiv_zero_by_x_vec_undef(<2 x double> %x) {
; CHECK-LABEL: @fdiv_zero_by_x_vec_undef(
-; CHECK-NEXT: [[R:%.*]] = fdiv nnan nsz <2 x double> <double 0.000000e+00, double undef>, [[X:%.*]]
-; CHECK-NEXT: ret <2 x double> [[R]]
+; CHECK-NEXT: ret <2 x double> zeroinitializer
;
%r = fdiv nnan nsz <2 x double> <double 0.0, double undef>, %x
ret <2 x double> %r
OpenPOWER on IntegriCloud