HomePhabricator

[RISCV] Support insertion of misaligned subvectors

Authored by frasercrmck on Thu, Feb 18, 8:48 AM.

Description

[RISCV] Support insertion of misaligned subvectors

This patch extends the support for RVV INSERT_SUBVECTOR to cover those
which don't align to a vector register boundary. Like the support for
EXTRACT_SUBVECTOR in D96959, it accomplishes this by extracting the
nearest register-sized subvector (a subregister operation), then sliding
the vector down with VSLIDEDOWN, inserting the subvector to the first
position, and sliding the vector back up again afterwards.

Unlike subvector extraction, for vectors that occupy less than a full
vector register we must preserve the untouched elements. We do this by
lowering to an LMUL=1 INSERT_SUBVECTOR using the above method and
lowering that to a VSLIDEUP with a zero offset. This uses a
tail-undisturbed policy and so has the effect of "sliding in" the
subvector elements while preserving the surrounding ones.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D96972

Details

Committed
frasercrmckTue, Feb 23, 2:31 AM
Reviewer
craig.topper
Differential Revision
D96972: [RISCV] Support insertion of misaligned subvectors
Parents
rG1fff7c892452: Fix unused variable
Branches
Unknown
Tags
Unknown