[DAGCombiner] Initial support for the fast-math flag contract
authorAdam Nemet <anemet@apple.com>
Thu, 30 Mar 2017 18:53:04 +0000 (18:53 +0000)
committerAdam Nemet <anemet@apple.com>
Thu, 30 Mar 2017 18:53:04 +0000 (18:53 +0000)
commitedaec6de73aa24dee60645f0a8015ae0fe1849f3
treefa638ef77354e231493dc8ec83d30d6b64fcef7f
parent1052b7236121f6934e46988e11b4e08d3dbf3951
[DAGCombiner] Initial support for the fast-math flag contract

Now alternatively to the TargetOption.AllowFPOpFusion global flag, FMUL->FADD
can also use the per operation FMF to allow fusion.

The idea here is not to port everything to the new scheme (e.g. fused
multiply-and-sub will be ported later) but that this work all the way from
clang.

The transformation is conditionalized on *both* the FADD and the FMUL having
the FMF contract flag.

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

llvm-svn: 299096
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/AArch64/neon-fma-FMF.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/fma-aggr-FMF.ll [new file with mode: 0644]