[PATCH] D116191: [X86] isVectorShiftByScalarCheap - vXi8 select(shift(x,splat0),shift(x,splat1)) is better than shift(x,select(splat0,splat1))

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 22 14:34:48 PST 2021


RKSimon created this revision.
RKSimon added reviewers: spatel, pengfei, craig.topper, lebedev.ri.
Herald added subscribers: hiraditya, tschuett.
RKSimon requested review of this revision.
Herald added a project: LLVM.

Even though we don't have vXi8 vector shifts (apart from XOP), it is still better to prefer shift (or funnel-shift/rotate) by scalar where possible.

https://llvm.godbolt.org/z/6ss6ffTxv


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116191

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/Transforms/CodeGenPrepare/X86/vec-shift-inseltpoison.ll
  llvm/test/Transforms/CodeGenPrepare/X86/vec-shift.ll
  llvm/test/Transforms/CodeGenPrepare/X86/x86-shuffle-sink-inseltpoison.ll
  llvm/test/Transforms/CodeGenPrepare/X86/x86-shuffle-sink.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116191.395933.patch
Type: text/x-patch
Size: 15699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211222/0a2887fc/attachment-0001.bin>


More information about the llvm-commits mailing list