[PATCH] D56869: [CodeGen][X86] Expand UADDSAT to NOT+UMIN+ADD

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 11:33:39 PST 2019


nikic created this revision.
nikic added reviewers: RKSimon, spatel.
Herald added a subscriber: llvm-commits.

Followup to D56636 <https://reviews.llvm.org/D56636>, this time handling the UADDSAT case by expanding `uadd.sat(a, b)` to `umin(a, ~b) + b`.

For the cost model I'm assuming the vector not (pcmpeq idiom + pxor) has a cost of 1, not sure if that's alright.


Repository:
  rL LLVM

https://reviews.llvm.org/D56869

Files:
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/Target/X86/X86TargetTransformInfo.cpp
  test/Analysis/CostModel/X86/arith-usat.ll
  test/CodeGen/X86/uadd_sat.ll
  test/CodeGen/X86/uadd_sat_vec.ll
  test/Transforms/SLPVectorizer/X86/arith-add-usat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56869.182360.patch
Type: text/x-patch
Size: 171304 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190117/2d4a5dbc/attachment-0001.bin>


More information about the llvm-commits mailing list