[PATCH] D86429: [X86] Make lowerShuffleAsLanePermuteAndShuffle use sublanes on AVX2

TellowKrinkle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 00:07:35 PDT 2020


TellowKrinkle created this revision.
TellowKrinkle added reviewers: RKSimon, craig.topper.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
TellowKrinkle requested review of this revision.

Extends lowerShuffleAsLanePermuteAndShuffle to search for opportunities to use vpermq (64-bit cross-lane shuffle) and vpermd (32-bit cross-lane shuffle) to get elements into the correct lane, in addition to the 128-bit full-lane permutes it previously searched for

This is especially helpful in cross-lane byte shuffles, where the alternative tends to be "vpshufb both lanes separately and blend them with a vpblendvb", which is very expensive, especially on Haswell where vpblendvb uses the same execution port as all the shuffles.

Addresses Bug 47262 <https://bugs.llvm.org/show_bug.cgi?id=47262>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86429

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/bitcast-int-to-vector-bool-sext.ll
  llvm/test/CodeGen/X86/bitcast-int-to-vector-bool-zext.ll
  llvm/test/CodeGen/X86/bitcast-int-to-vector-bool.ll
  llvm/test/CodeGen/X86/oddshuffles.ll
  llvm/test/CodeGen/X86/vector-sext.ll
  llvm/test/CodeGen/X86/vector-shuffle-256-v16.ll
  llvm/test/CodeGen/X86/vector-shuffle-256-v32.ll
  llvm/test/CodeGen/X86/vector-shuffle-512-v32.ll
  llvm/test/CodeGen/X86/vector-shuffle-combining-avx2.ll
  llvm/test/CodeGen/X86/vector-shuffle-combining.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86429.287299.patch
Type: text/x-patch
Size: 143480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/52d8183c/attachment-0001.bin>


More information about the llvm-commits mailing list