HomePhabricator

[InstCombine] Simplify fma multiplication to nan for undef or nan operands.

Authored by fhahn on Oct 2 2019, 5:32 AM.

Description

[InstCombine] Simplify fma multiplication to nan for undef or nan operands.

In similar fashion to D67721, we can simplify FMA multiplications if any
of the operands is NaN or undef. In instcombine, we will simplify the
FMA to an fadd with a NaN operand, which in turn gets folded to NaN.

Note that this just changes SimplifyFMAFMul, so we still not catch the
case where only the Add part of the FMA is Nan/Undef.

Reviewers: cameron.mcinally, mcberg2017, spatel, arsenm

Reviewed By: cameron.mcinally

Differential Revision: https://reviews.llvm.org/D68265

llvm-svn: 373459

Details