[PATCH] D150612: AMDGPU: Expand casted f16 fmed3 pattern to fmin/fmax on gfx8

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 13:59:15 PDT 2023


arsenm created this revision.
arsenm added reviewers: AMDGPU, foad, Pierre-vh, rampitec, b-sumner.
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.

If we have legal f16 instructions but no f16 med3, we can save
one instruction by expanding out the min/max sequence compared
to casting to f32 and casting back.


https://reviews.llvm.org/D150612

Files:
  llvm/lib/Target/AMDGPU/AMDGPU.td
  llvm/lib/Target/AMDGPU/AMDGPUCombine.td
  llvm/lib/Target/AMDGPU/AMDGPUCombinerHelper.cpp
  llvm/lib/Target/AMDGPU/AMDGPUCombinerHelper.h
  llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
  llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.cpp
  llvm/lib/Target/AMDGPU/SIISelLowering.h
  llvm/test/CodeGen/AMDGPU/fmed3-cast-combine.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150612.522333.patch
Type: text/x-patch
Size: 33705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230515/0e4b64bf/attachment.bin>


More information about the llvm-commits mailing list