[PATCH] D87215: [SelectionDAG][X86][ARM] Teach ExpandIntRes_ABS to use sra+add+xor expansion when ADDCARRY is supported.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 6 18:20:41 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: spatel, RKSimon, efriedma.
Herald added subscribers: danielkiss, ecnelises, dmgreen, hiraditya, kristof.beyls.
Herald added a project: LLVM.
craig.topper requested review of this revision.

Rather than using SELECT instructions, use SRA, UADDO/ADDCARRY and
XORs to expand ABS. This is the multi-part version of the sequence
we use in LegalizeDAG.

It's also the same as the Custom sequence uses for i64 on 32-bit
and i128 on 64-bit. So we can remove the X86 customization.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87215

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/Thumb2/mve-abs.ll
  llvm/test/CodeGen/X86/abs.ll
  llvm/test/CodeGen/X86/iabs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87215.290157.patch
Type: text/x-patch
Size: 11407 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200907/aa4e0076/attachment-0001.bin>


More information about the llvm-commits mailing list