[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
diff --git a/llvm/test/Transforms/InstSimplify/fast-math.ll b/llvm/test/Transforms/InstSimplify/fast-math.ll
index 90532fa..c499af3 100644
--- a/llvm/test/Transforms/InstSimplify/fast-math.ll
+++ b/llvm/test/Transforms/InstSimplify/fast-math.ll
@@ -91,6 +91,16 @@
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) {