Skip to content

Commit

Permalink
[InstSimplify] add test for fsub with inf operand; NFC
Browse files Browse the repository at this point in the history
Verify that constant negation works with a partial undef vector.
Also, remove a bogus TODO comment on a related test.
  • Loading branch information
rotateright committed Nov 11, 2022
1 parent 4d33cf4 commit c2c48f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/InstSimplify/fp-undef-poison.ll
Expand Up @@ -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(
Expand Down

0 comments on commit c2c48f0

Please sign in to comment.