[InstSimplify] fold fsub nnan with Inf operand
authorSanjay Patel <spatel@rotateright.com>
Thu, 10 Nov 2022 22:35:36 +0000 (17:35 -0500)
committerSanjay Patel <spatel@rotateright.com>
Fri, 11 Nov 2022 13:42:44 +0000 (08:42 -0500)
commit21f1b2da95a32307d42128d9fb446c57f0fb8ee9
treeb5ee449804c2c6f16e075b1fa63d37b0f735f1b9
parent15b2702e83fa1e99e56b51a4254e8dc4f331ca9d
[InstSimplify] fold fsub nnan with Inf operand

Similar to fbc2c8f2fbbb, but if we have a non-canonical
fsub with constant operand 1, then flip the sign of the
Infinity:
https://alive2.llvm.org/ce/z/vKWfhW

If Infinity is operand 0, then the sign remains:
https://alive2.llvm.org/ce/z/73d97C
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/floating-point-arithmetic.ll
llvm/test/Transforms/InstSimplify/fp-undef-poison.ll