[InstSimplify] Match 1.0 and 0.0 for both operands in SimplifyFMAMul
authorFlorian Hahn <flo@fhahn.com>
Wed, 25 Sep 2019 19:33:26 +0000 (19:33 +0000)
committerFlorian Hahn <flo@fhahn.com>
Wed, 25 Sep 2019 19:33:26 +0000 (19:33 +0000)
commitd663efe23a266d7b6dc1718324726777aa0baacd
treeb484ec7812dd27a17b4e7691d36bbb6dfb0b8c33
parent3a7da6a7df3431850308cfaf3c120228f49083c9
[InstSimplify] Match 1.0 and 0.0 for both operands in SimplifyFMAMul

Because we do not constant fold multiplications in SimplifyFMAMul,
we match 1.0 and 0.0 for both operands, as multiplying by them
is guaranteed to produce an exact result (if it is allowed to do so).

Note that it is not enough to just swap the operands to ensure a
constant is on the RHS, as we want to also cover the case with
2 constants.

Reviewers: lebedev.ri, spatel, reames, scanon

Reviewed By: lebedev.ri, reames

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

llvm-svn: 372915
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstCombine/fma.ll