[PATCH] D127818: [PowerPC] Skip combine for vector_shuffles when two scalar_to_vector nodes are different vector types.

Amy Kwan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 18:50:01 PDT 2022


amyk created this revision.
amyk added reviewers: PowerPC, power-llvm-team, nemanjai, stefanp.
amyk added projects: LLVM, PowerPC.
Herald added subscribers: shchenz, hiraditya.
Herald added a project: All.
amyk requested review of this revision.

Currently in `combineVectorShuffle()`, we update the shuffle mask if either
input vector comes from a scalar_to_vector, and we keep the respective input
vectors in its permuted form by producing `PPCISD::SCALAR_TO_VECTOR_PERMUTED`.

However, it is possible that we end up in a situation where both input vectors
to the vector_shuffle are scalar_to_vector, and are different vector types.
In situations like this, the shuffle mask is updated incorrectly as the current
code assumes both scalar_to_vector inputs are the same vector type.

This patch skips the combines for vector_shuffle if both input vectors are
scalar_to_vector, and if they are of different vector types. A follow up patch
will focus on fixing this issue afterwards, in order to correctly update the
shuffle mask.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127818

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/test/CodeGen/PowerPC/p8-scalar_vector_conversions.ll
  llvm/test/CodeGen/PowerPC/scalar_to_vector_shuffle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127818.436997.patch
Type: text/x-patch
Size: 8476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220615/03cbc732/attachment.bin>


More information about the llvm-commits mailing list