AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all
authorStephen Lin <stephenwlin@gmail.com>
Tue, 9 Jul 2013 18:16:56 +0000 (18:16 +0000)
committerStephen Lin <stephenwlin@gmail.com>
Tue, 9 Jul 2013 18:16:56 +0000 (18:16 +0000)
commite54885af9b54bfc7436a928a48d3db1ef88a2a70
treed02aedc19d4bde21504dba8eff95d7657487e010
parent033e0a94cbb3df8e0f48cebe0ac5b4a024c85b2d
AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all
in-tree implementations of TargetLoweringBase::isFMAFasterThanMulAndAdd in
order to resolve the following issues with fmuladd (i.e. optional FMA)
intrinsics:

1. On X86(-64) targets, ISD::FMA nodes are formed when lowering fmuladd
intrinsics even if the subtarget does not support FMA instructions, leading
to laughably bad code generation in some situations.

2. On AArch64 targets, ISD::FMA nodes are formed for operations on fp128,
resulting in a call to a software fp128 FMA implementation.

3. On PowerPC targets, FMAs are not generated from fmuladd intrinsics on types
like v2f32, v8f32, v4f64, etc., even though they promote, split, scalarize,
etc. to types that support hardware FMAs.

The function has also been slightly renamed for consistency and to force a
merge/build conflict for any out-of-tree target implementing it. To resolve,
see comments and fixed in-tree examples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185956 91177308-0d34-0410-b5e6-96231b3b80d8
17 files changed:
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/AArch64/fp-dp3.ll
test/CodeGen/AArch64/illegal-float-ops.ll
test/CodeGen/PowerPC/vec_fmuladd.ll [new file with mode: 0644]
test/CodeGen/X86/extended-fma-contraction.ll [new file with mode: 0644]
test/CodeGen/X86/fma_patterns_wide.ll [new file with mode: 0644]
test/CodeGen/X86/wide-fma-contraction.ll