HomePhabricator

[InstCombine] fold fneg into constant operand of fmul/fdiv

Authored by spatel on Aug 8 2018, 7:29 AM.

Description

[InstCombine] fold fneg into constant operand of fmul/fdiv

This accounts for the missing IR fold noted in D50195. We don't need any fast-math to enable the negation transform.
FP negation can always be folded into an fmul/fdiv constant to eliminate the fneg.

I've limited this to one-use to ensure that we are eliminating an instruction rather than replacing fneg by a
potentially expensive fdiv or fmul.

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

llvm-svn: 339248