[PATCH] D114964: [DAG] Create fptoui.sat from clamped fptoui

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 2 08:38:02 PST 2021


dmgreen created this revision.
dmgreen added reviewers: spatel, RKSimon, craig.topper, tlively, efriedma, SjoerdMeijer.
Herald added subscribers: armkevincheng, eric-k256, frasercrmck, ecnelises, luismarques, apazos, sameer.abuasal, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, kristof.beyls, jgravelle-google, sbc100, dschuff.
Herald added a reviewer: sjarus.
dmgreen requested review of this revision.
Herald added subscribers: MaskRay, aheejin.
Herald added a project: LLVM.

This is the unsigned variant of D111976 <https://reviews.llvm.org/D111976>, where we convert a clamped fptoui to a fptoui.sat. Because we are unsigned, the condition this time is only UMIN of UINT_MAX. Similarly to D111976 <https://reviews.llvm.org/D111976> it handles ISD::UMIN, ISD::SETCC/ISD::SELECT, ISD::VSELECT or ISD::SELECT_CC nodes.

This especially helps on ARM/AArch64 where the vcvt instructions naturally saturate the result.


https://reviews.llvm.org/D114964

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/fpclamptosat.ll
  llvm/test/CodeGen/AArch64/fpclamptosat_vec.ll
  llvm/test/CodeGen/ARM/fpclamptosat.ll
  llvm/test/CodeGen/RISCV/fpclamptosat.ll
  llvm/test/CodeGen/Thumb2/mve-fpclamptosat_vec.ll
  llvm/test/CodeGen/WebAssembly/fpclamptosat.ll
  llvm/test/CodeGen/WebAssembly/fpclamptosat_vec.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114964.391337.patch
Type: text/x-patch
Size: 47359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211202/5d2df497/attachment-0001.bin>


More information about the llvm-commits mailing list