[PATCH] D108058: [SelectionDAG] Optimize expansion for rotates/funnel shifts.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 13 15:27:24 PDT 2021


efriedma created this revision.
efriedma added reviewers: craig.topper, RKSimon, lebedev.ri, dmgreen, nemanjai.
Herald added subscribers: frasercrmck, ecnelises, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, atanasyan, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, sdardis.
efriedma requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

If the type of a funnel shift needs to be expanded, expand it to two funnel shifts instead of regular shifts.  For constant shifts, this doesn't make much difference, but for variable shifts it allows a more optimal lowering.

Also use the optimized funnel shift lowering for rotates.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108058

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/test/CodeGen/ARM/funnel-shift-rot.ll
  llvm/test/CodeGen/ARM/funnel-shift.ll
  llvm/test/CodeGen/Mips/funnel-shift-rot.ll
  llvm/test/CodeGen/Mips/funnel-shift.ll
  llvm/test/CodeGen/PowerPC/funnel-shift-rot.ll
  llvm/test/CodeGen/PowerPC/funnel-shift.ll
  llvm/test/CodeGen/RISCV/rv32zbb-zbp.ll
  llvm/test/CodeGen/RISCV/rv32zbt.ll
  llvm/test/CodeGen/X86/fshl.ll
  llvm/test/CodeGen/X86/fshr.ll
  llvm/test/CodeGen/X86/funnel-shift-rot.ll
  llvm/test/CodeGen/X86/funnel-shift.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108058.366361.patch
Type: text/x-patch
Size: 97638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210813/197d8b3a/attachment.bin>


More information about the llvm-commits mailing list