AMDGPU: Swap order of operands in fadd/fsub combine
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 22 Dec 2016 04:03:40 +0000 (04:03 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 22 Dec 2016 04:03:40 +0000 (04:03 +0000)
commite7d8ed32f9f98d02801c2a0a2dd094689e830a21
tree9ce77f21213198c01bd01905a5bc84f7ce6d3b53
parent46e6b7adef59d96f30c173ac6ade57d81d7c7b1e
AMDGPU: Swap order of operands in fadd/fsub combine

FMA is canonicalized to constant in the middle operand. Do
the same so fmad matches and avoid an extra combine step.

llvm-svn: 290313
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/fmul-2-combine-multi-use.ll
llvm/test/CodeGen/AMDGPU/fmuladd.f16.ll
llvm/test/CodeGen/AMDGPU/fmuladd.f32.ll