AMDGPU/GlobalISel: Legalize G_FMAD
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 13 Sep 2019 00:44:35 +0000 (00:44 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 13 Sep 2019 00:44:35 +0000 (00:44 +0000)
commit4d3391803462433b05a3344e6c37435f725637c4
treed4c536b7baf26b1676377613d61ac7ea0af9c208
parent38f6b3fd8dd7dc3a3b4eae63738d5d3a741b2227
AMDGPU/GlobalISel: Legalize G_FMAD

Unlike SelectionDAG, treat this as a normally legalizable operation.
In SelectionDAG this is supposed to only ever formed if it's legal,
but I've found that to be restricting. For AMDGPU this is contextually
legal depending on whether denormal flushing is allowed in the use
function.

Technically we currently treat the denormal mode as a subtarget
feature, so custom lowering could be avoided. However I consider this
to be a defect, and this should be contextually dependent on the
controllable rounding mode of the parent function.

llvm-svn: 371800
llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.h
llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fmad.mir [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-fmad.s16.mir [new file with mode: 0644]