]> granicus.if.org Git - llvm/commit
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)
commitbf6eeaf07e1692fab0af8420bab82a2e420572e2
treef84aea19a7238d5ea8b95b6be24153ab89c16afb
parentbc76bf812b7b5146180839e6042d8f4571d33687
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371800 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
lib/Target/AMDGPU/AMDGPULegalizerInfo.h
lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
test/CodeGen/AMDGPU/GlobalISel/legalize-fmad.mir [new file with mode: 0644]
test/CodeGen/AMDGPU/GlobalISel/legalize-fmad.s16.mir [new file with mode: 0644]