Page MenuHomePhabricator

[AArch64][SVE] Add SplatVector Intrinsic
Changes PlannedPublic

Authored by huntergr on Jun 5 2018, 5:40 AM.

Details

Summary

Adds an experimental intrinsic to replicate a scalar value across all
elements of a vector. This is needed for scalable vectors, since
BUILD_VECTOR cannot be used.

Adds code to SelectionDAGBuilder to use this for IR splats using
zeroinitializer and shufflevector (and deliberately asserting in
cases we have not handled yet -- variable shuffles will be handled
later in a separate patch).

Adds a variant of 'getShuffleMask' which can take Value for a mask
instead of a constant. If the VectorType of the mask is scalable or
if the mask value is not a constant, this returns false to indicate
the calling code must handle the shuffle differently. If it is
constant and non scalable, then it calls the existing 'getShuffleMask'
with the given arguments then returns true.

Adds code to lower and legalize the intrinsic in the AArch64 for
integer element types (other than i1, which will be handled later).

Adds a simple unit test for the "mov" alias of the SVE "dup" instruction.

Part of the initial SVE codegen series, rfc will be posted soon. Note: this patch is currently just to support the scalable vector codegen rfc, and does not need a full review yet.

Diff Detail

Event Timeline

huntergr created this revision.Jun 5 2018, 5:40 AM
This comment was removed by rkruppe.
huntergr planned changes to this revision.Mar 22 2019, 3:02 AM

Needs to be updated with better isel patterns (and possibly a new ISD?), instead of just the bare minimum required for demonstration.