Page MenuHomePhabricator

[RISCV] Pass undef VECTOR_SHUFFLE indices on to BUILD_VECTOR

Authored by frasercrmck on Jun 23 2021, 8:36 AM.



Often when lowering vector shuffles, we split the shuffle into two
LHS/RHS shuffles which are then blended together. To do so we split the
original indices into two, indexed into each respective vector. These
two index vectors are then separately lowered as BUILD_VECTORs.

This patch forwards on any undef indices to the BUILD_VECTOR, rather
than having the VECTOR_SHUFFLE lowering decide on an optimal concrete
index. The motiviation for ths change is so that we don't duplicate
optimization logic between the two lowering methods and let BUILD_VECTOR
do what it does best.

Propagating undef in this way allows us, for example, to generate
vid.v to produce the LHS indices of commonly-used interleave-type
shuffles. I have designs on further optimizing interleave-type and other
common shuffle patterns in the near future.

Diff Detail

Event Timeline

frasercrmck created this revision.Jun 23 2021, 8:36 AM
frasercrmck requested review of this revision.Jun 23 2021, 8:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2021, 8:36 AM
This revision is now accepted and ready to land.Jun 25 2021, 12:57 PM
This revision was landed with ongoing or failed builds.Tue, Jul 13, 2:50 AM
This revision was automatically updated to reflect the committed changes.