[DAGCombiner] Tighten reasscociation of visitFMA
authorQiu Chaofan <qiucofan@cn.ibm.com>
Tue, 20 Oct 2020 02:13:01 +0000 (10:13 +0800)
committerQiu Chaofan <qiucofan@cn.ibm.com>
Tue, 20 Oct 2020 02:13:01 +0000 (10:13 +0800)
commit1b2fe71ecf6bd647a244fc64c231e31dfe1faaa2
treefb1cb52cba2ccf65d5f4c5c676beccaa3c455592
parent76c0092665867a6defcd328ba0d0d976eb65d991
[DAGCombiner] Tighten reasscociation of visitFMA

From LangRef, FMF contract should not enable reassociating to form
arbitrary contractions. So it should not help rearrange nodes like
(fma (fmul x, c1), c2, y) into (fma x, c1*c2, y).

Reviewed By: spatel

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