AMDGPU: Fix infinite loop in DAG combine with fneg + fma
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 12 Jun 2021 15:21:57 +0000 (11:21 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 18 Jun 2021 23:09:03 +0000 (19:09 -0400)
commitd6467e00dfccf10aa91e5a1d55d981a9b13642a3
treeac4d8b3102e0beb896629ccf80c77d9fcda265d2
parentfb32de9e97af0921242a021e30020ffacf7aa6e2
AMDGPU: Fix infinite loop in DAG combine with fneg + fma

We were not reporting isFNegFree for v2f32, although it is effectively
free after legalization. The generic combine was pulling fneg out of
the fma source operands, and the AMDGPU combine was doing the
opposite.
llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
llvm/test/CodeGen/AMDGPU/fneg-combines.ll