[PATCH] D90050: AMDGPU/GlobalISel: Add integer med3 combines

Petar Avramovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 08:40:48 PDT 2020


Petar.Avramovic created this revision.
Petar.Avramovic added reviewers: foad, arsenm.
Herald added subscribers: llvm-commits, kerbowa, hiraditya, t-tye, tpr, dstuttard, rovka, yaxunl, nhaehnle, jvesely, kzhuravl.
Herald added a project: LLVM.
Petar.Avramovic requested review of this revision.
Herald added a subscriber: wdng.

Add signed and unsigned integer version of med3 combine.
Source pattern is min(max(Val, K0), K1 <https://reviews.llvm.org/K1>) or max(min(Val, K1 <https://reviews.llvm.org/K1>), K0)
where K0 and K1 <https://reviews.llvm.org/K1> are constants and K0 < K1 <https://reviews.llvm.org/K1>. Destination is med3
that corresponds to signedness of min/max in source.


https://reviews.llvm.org/D90050

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCombine.td
  llvm/lib/Target/AMDGPU/AMDGPUGISel.td
  llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
  llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
  llvm/lib/Target/AMDGPU/SIInstructions.td
  llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-smed3.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizercombiner-umed3.mir
  llvm/test/CodeGen/AMDGPU/GlobalISel/smed3.ll
  llvm/test/CodeGen/AMDGPU/GlobalISel/umed3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90050.300309.patch
Type: text/x-patch
Size: 34352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201023/48b6a843/attachment-0001.bin>


More information about the llvm-commits mailing list