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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 05:45:34 PDT 2021


RKSimon created this revision.
RKSimon added reviewers: craig.topper, dmgreen, foad, lebedev.ri, nemanjai, efriedma.
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.
RKSimon requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

(Branched from D108058 <https://reviews.llvm.org/D108058> as getting this completed should help unlock some other WIP patches).

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.

Original Patch: @efriedma (Eli Friedman)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112443

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  llvm/test/CodeGen/AArch64/funnel-shift.ll
  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/RISCV/shifts.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: D112443.381953.patch
Type: text/x-patch
Size: 195097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211025/fac714ea/attachment-0001.bin>


More information about the llvm-commits mailing list