[PATCH] D96622: [DAG] PromoteIntRes_ADDSUBSHLSAT - use promoted ISD::USUBSAT directly

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 11:16:16 PST 2021


RKSimon created this revision.
RKSimon added reviewers: craig.topper, dmgreen, nikic, lebedev.ri, arsenm, spatel.
Herald added subscribers: kerbowa, pengfei, hiraditya, nhaehnle, jvesely.
RKSimon requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

As discussed on D96413 <https://reviews.llvm.org/D96413>, as long as the promoted bits of the args are zero we can use the basic ISD::USUBSAT pattern directly, without the shifting like we do for other ops.

I think something similar should be possible for ISD::UADDSAT as well, which I'll look at later.

Also, create a ISD::USUBSAT node directly - this will be expanded back by the legalizer later on if necessary.

https://alive2.llvm.org/ce/


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96622

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/test/CodeGen/AArch64/usub_sat_vec.ll
  llvm/test/CodeGen/AMDGPU/usubsat.ll
  llvm/test/CodeGen/ARM/usub_sat_plus.ll
  llvm/test/CodeGen/X86/usub_sat_plus.ll
  llvm/test/CodeGen/X86/usub_sat_vec.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96622.323409.patch
Type: text/x-patch
Size: 15986 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210212/58e7a71a/attachment-0001.bin>


More information about the llvm-commits mailing list