summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
diff options
context:
space:
mode:
authorCameron McInally <cameron.mcinally@nyu.edu>2019-05-17 18:34:35 +0000
committerCameron McInally <cameron.mcinally@nyu.edu>2019-05-17 18:34:35 +0000
commitbebc7d6a4e5dc0531f51dc98a085d1a9170351b3 (patch)
tree828f8e91ef81951907fe1c571e0adea7c922eb25 /llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
parente78ac9cc72c9a6cfebfa22eb2a87b5d256defdff (diff)
downloadbcm5719-llvm-bebc7d6a4e5dc0531f51dc98a085d1a9170351b3.tar.gz
bcm5719-llvm-bebc7d6a4e5dc0531f51dc98a085d1a9170351b3.zip
[NFC][InstSimplify] Precommit new unary fneg test
llvm-svn: 361060
Diffstat (limited to 'llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll')
-rw-r--r--llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
index 868c4a20735..b24293cead4 100644
--- a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
+++ b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
@@ -28,6 +28,18 @@ define float @fsub_-0_-0_x(float %a) {
ret float %ret
}
+; fsub -0.0, (fneg X) ==> X
+define float @fneg_x(float %a) {
+; CHECK-LABEL: @fneg_x(
+; CHECK-NEXT: %t1 = fneg float %a
+; CHECK-NEXT: %ret = fsub float -0.000000e+00, %t1
+; CHECK-NEXT: ret float %ret
+;
+ %t1 = fneg float %a
+ %ret = fsub float -0.0, %t1
+ ret float %ret
+}
+
define <2 x float> @fsub_-0_-0_x_vec(<2 x float> %a) {
; CHECK-LABEL: @fsub_-0_-0_x_vec(
; CHECK-NEXT: ret <2 x float> [[A:%.*]]
@@ -37,6 +49,17 @@ define <2 x float> @fsub_-0_-0_x_vec(<2 x float> %a) {
ret <2 x float> %ret
}
+define <2 x float> @fneg_x_vec(<2 x float> %a) {
+; CHECK-LABEL: @fneg_x_vec(
+; CHECK-NEXT: %t1 = fneg <2 x float> %a
+; CHECK-NEXT: %ret = fsub <2 x float> <float -0.000000e+00, float -0.000000e+00>, %t1
+; CHECK-NEXT: ret <2 x float> %ret
+;
+ %t1 = fneg <2 x float> %a
+ %ret = fsub <2 x float> <float -0.0, float -0.0>, %t1
+ ret <2 x float> %ret
+}
+
define <2 x float> @fsub_-0_-0_x_vec_undef_elts(<2 x float> %a) {
; CHECK-LABEL: @fsub_-0_-0_x_vec_undef_elts(
; CHECK-NEXT: ret <2 x float> [[A:%.*]]
@@ -46,6 +69,17 @@ define <2 x float> @fsub_-0_-0_x_vec_undef_elts(<2 x float> %a) {
ret <2 x float> %ret
}
+define <2 x float> @fneg_x_vec_undef_elts(<2 x float> %a) {
+; CHECK-LABEL: @fneg_x_vec_undef_elts(
+; CHECK-NEXT: %t1 = fneg <2 x float> %a
+; CHECK-NEXT: %ret = fsub <2 x float> <float -0.000000e+00, float undef>, %t1
+; CHECK-NEXT: ret <2 x float> %ret
+;
+ %t1 = fneg <2 x float> %a
+ %ret = fsub <2 x float> <float -0.0, float undef>, %t1
+ ret <2 x float> %ret
+}
+
; fsub -0.0, (fsub 0.0, X) != X
define float @fsub_-0_0_x(float %a) {
; CHECK-LABEL: @fsub_-0_0_x(
OpenPOWER on IntegriCloud