[InstSimplify] add test for fsub with inf operand; NFC
authorSanjay Patel <spatel@rotateright.com>
Fri, 11 Nov 2022 13:51:13 +0000 (08:51 -0500)
committerSanjay Patel <spatel@rotateright.com>
Fri, 11 Nov 2022 14:17:20 +0000 (09:17 -0500)
Verify that constant negation works with a partial undef vector.
Also, remove a bogus TODO comment on a related test.

llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
llvm/test/Transforms/InstSimplify/fp-undef-poison.ll

index 31025c1..3529da6 100644 (file)
@@ -877,6 +877,14 @@ define double @fsub_nnan_inf_op1(double %x) {
   ret double %r
 }
 
+define <2 x double> @fsub_nnan_inf_op1_vec(<2 x double> %x) {
+; CHECK-LABEL: @fsub_nnan_inf_op1_vec(
+; CHECK-NEXT:    ret <2 x double> <double 0x7FF0000000000000, double poison>
+;
+  %r = fsub nnan <2 x double> %x, <double 0xfff0000000000000, double poison>
+  ret <2 x double> %r
+}
+
 define <2 x double> @fsub_nnan_neginf_op0(<2 x double> %x) {
 ; CHECK-LABEL: @fsub_nnan_neginf_op0(
 ; CHECK-NEXT:    ret <2 x double> <double 0xFFF0000000000000, double poison>
index 7da1c95..cb2026d 100644 (file)
@@ -283,7 +283,7 @@ define double @fsub_nnan_inf_op0(double %x) {
   ret double %r
 }
 
-; TODO: Should simplify to -inf.
+; This can't simplify - the result is infinity, but the sign is unknown.
 
 define double @fmul_nnan_inf_op1(double %x) {
 ; CHECK-LABEL: @fmul_nnan_inf_op1(