[PATCH] D157111: AMDGPU: Try to select fmul by power of 2 to ldexp

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 08:39:30 PDT 2023


arsenm created this revision.
arsenm added reviewers: AMDGPU, foad, Pierre-vh, rampitec.
Herald added subscribers: StephenFan, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

For the f64 case, this gives us a cheaper to materialize 32-bit
constant. It's less obviously a win for f32 and f16. It forces us to
use a VOP3 encoding so it's a neutral code size change.

      

GlobalISel cases don't work because of the constant-is-copy-to-vgpr
problem.


https://reviews.llvm.org/D157111

Files:
  llvm/lib/Target/AMDGPU/AMDGPUGISel.td
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h
  llvm/lib/Target/AMDGPU/SIInstructions.td
  llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fmul.mir
  llvm/test/CodeGen/AMDGPU/fmul-to-ldexp.ll
  llvm/test/CodeGen/AMDGPU/fp_to_sint.f64.ll
  llvm/test/CodeGen/AMDGPU/fp_to_uint.f64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157111.547233.patch
Type: text/x-patch
Size: 101451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230804/fece997b/attachment.bin>


More information about the llvm-commits mailing list