[DAGCombine] Check the uses of negated floating constant and remove the hack
authorQingShan Zhang <qshanz@cn.ibm.com>
Thu, 5 Mar 2020 03:42:50 +0000 (03:42 +0000)
committerQingShan Zhang <qshanz@cn.ibm.com>
Thu, 5 Mar 2020 03:42:50 +0000 (03:42 +0000)
commit3906ae387f0775dfe4426e4336748269fafbd190
tree772f9fc78ea44facf5516669aa4c70a578420344
parentea6eb813c7cb06311c48706bc82ee103c9a52182
[DAGCombine] Check the uses of negated floating constant and remove the hack

PowerPC hits an assertion due to somewhat the same reason as https://reviews.llvm.org/D70975.
Though there are already some hack, it still failed with some case, when the operand 0 is NOT
a const fp, it is another fma that with const fp. And that const fp is negated which result in multi-uses.

A better fix is to check the uses of the negated const fp. If there are already use of its negated
value, we will have benefit as no extra Node is added.

Differential revision: https://reviews.llvm.org/D75501
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/PowerPC/fma-combine.ll