This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by amyk on Jun 14 2022, 6:49 PM.

Details

Summary

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.

Diff Detail

Event Timeline

amyk created this revision.Jun 14 2022, 6:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 6:49 PM
amyk requested review of this revision.Jun 14 2022, 6:49 PM
nemanjai accepted this revision.Jun 15 2022, 10:14 AM

LGTM. Thanks for the fix.

This revision is now accepted and ready to land.Jun 15 2022, 10:14 AM
This revision was landed with ongoing or failed builds.Jun 15 2022, 12:12 PM
This revision was automatically updated to reflect the committed changes.