[DAGCombiner] Propagate FMF flags in FMA folding
authorQiu Chaofan <qiucofan@cn.ibm.com>
Sun, 13 Sep 2020 16:19:06 +0000 (00:19 +0800)
committerQiu Chaofan <qiucofan@cn.ibm.com>
Sun, 13 Sep 2020 16:19:06 +0000 (00:19 +0800)
commita4c535198643d1541b19f37a468c885a7baa7605
treed5acb504186c4292895e3583dc539d331e8145ff
parent9237fde48139400764377eb73e7e5d3bc5b7fffc
[DAGCombiner] Propagate FMF flags in FMA folding

DAG combiner folds (fma a 1.0 b) into (fadd a b) but the flag isn't
propagated into new fadd. This patch fixes that.

Some code in visitFMA is redundant and such support for vector constants
is missing. Need follow-up patch to clean.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D87037
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/PowerPC/fma-combine.ll