From c2c48f0c9693d2eda30a96660d4861bbd621d6ea Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Fri, 11 Nov 2022 08:51:13 -0500 Subject: [PATCH] [InstSimplify] add test for fsub with inf operand; NFC Verify that constant negation works with a partial undef vector. Also, remove a bogus TODO comment on a related test. --- .../Transforms/InstSimplify/floating-point-arithmetic.ll | 8 ++++++++ llvm/test/Transforms/InstSimplify/fp-undef-poison.ll | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll index 31025c128f940..3529da68a140b 100644 --- a/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll +++ b/llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll @@ -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> +; + %r = fsub nnan <2 x double> %x, + 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> diff --git a/llvm/test/Transforms/InstSimplify/fp-undef-poison.ll b/llvm/test/Transforms/InstSimplify/fp-undef-poison.ll index 7da1c95121b4d..cb2026df962c8 100644 --- a/llvm/test/Transforms/InstSimplify/fp-undef-poison.ll +++ b/llvm/test/Transforms/InstSimplify/fp-undef-poison.ll @@ -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(