[PATCH] D128732: [VectorCombine] Improve shuffle select shuffle-of-shuffles

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 07:13:06 PDT 2022


dmgreen created this revision.
dmgreen added reviewers: spatel, RKSimon, labrinea, SjoerdMeijer, samtebbs.
Herald added subscribers: nlopes, hiraditya.
Herald added a project: All.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This in an extension to the code added in D123911 <https://reviews.llvm.org/D123911> which added vector combine folding of shuffle-select patterns, attempting to reduce the total amount of shuffling required in patterns like:

  %x = shuffle %i1, %i2
  %y = shuffle %i1, %i2
  %a = binop %x, %y
  %b = binop %x, %y
  shuffle %a, %b, selectmask

This patch extends the handing of shuffles that are dependent on one another, which can arise from the SLP vectorizer, as-in:

  %x = shuffle %i1, %i2
  %y = shuffle %x

The input shuffles can also be emitted, in which case they are treated like identity shuffles. This patch also attempts to calculate a better ordering of input shuffles, which can help getting lower cost input shuffles, pushing complex shuffles further down the tree.


https://reviews.llvm.org/D128732

Files:
  llvm/lib/Transforms/Vectorize/VectorCombine.cpp
  llvm/test/Transforms/VectorCombine/AArch64/select-shuffle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128732.440597.patch
Type: text/x-patch
Size: 60899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220628/cd430ac1/attachment.bin>


More information about the llvm-commits mailing list