[DAGCombiner] Improve FMA support for interpolation patterns
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 21 Sep 2015 20:32:48 +0000 (20:32 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 21 Sep 2015 20:32:48 +0000 (20:32 +0000)
commit41fc6f18d7ba9fb0dc850961c5bf82def6f01d65
treed1499fcdb92b1a0f60359d97a8d1b28bf93ee6a5
parent76e7126dd33b88a51304682c475325952a901ac3
[DAGCombiner] Improve FMA support for interpolation patterns

This patch adds support for combining patterns such as (FMUL(FADD(1.0, x), y)) and (FMUL(FSUB(x, 1.0), y)) to their FMA equivalents.

This is useful in particular for linear interpolation cases such as (FADD(FMUL(x, t), FMUL(y, FSUB(1.0, t))))

Differential Revision: http://reviews.llvm.org/D13003

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248210 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AMDGPU/fma-combine.ll
test/CodeGen/AMDGPU/llvm.amdgpu.lrp.ll
test/CodeGen/X86/fma_patterns.ll