summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-02-29 12:18:25 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-02-29 12:18:25 +0000
commit6bb15021b37cd79e0fa8c361880756f90d9b5ba3 (patch)
tree2ba8919fac8941e173faa4e5e114487e1371562b /llvm/test/Transforms
parent76d76bb006c8b6305357f9797faf52a063ce38a9 (diff)
downloadbcm5719-llvm-6bb15021b37cd79e0fa8c361880756f90d9b5ba3.tar.gz
bcm5719-llvm-6bb15021b37cd79e0fa8c361880756f90d9b5ba3.zip
[InstSimplify] Restore fsub 0.0, (fsub 0.0, X) ==> X optzn
I accidentally removed this in r262212 but there was no test coverage to detect it. llvm-svn: 262215
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstSimplify/fast-math.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/fast-math.ll b/llvm/test/Transforms/InstSimplify/fast-math.ll
index 90532fa5db8..c499af33f52 100644
--- a/llvm/test/Transforms/InstSimplify/fast-math.ll
+++ b/llvm/test/Transforms/InstSimplify/fast-math.ll
@@ -91,6 +91,16 @@ define float @fsub_x_x(float %a) {
ret float %ret
}
+; fsub nsz 0.0, (fsub 0.0, X) ==> X
+; CHECK-LABEL: @fsub_0_0_x(
+define float @fsub_0_0_x(float %a) {
+ %t1 = fsub float 0.0, %a
+ %ret = fsub nsz float 0.0, %t1
+
+; CHECK: ret float %a
+ ret float %ret
+}
+
; fadd nsz X, 0 ==> X
; CHECK-LABEL: @nofold_fadd_x_0(
define float @nofold_fadd_x_0(float %a) {
OpenPOWER on IntegriCloud