[IR] Change vector.splice intrinsic to reject out-of-bounds indices
authorDavid Sherwood <david.sherwood@arm.com>
Fri, 17 Dec 2021 09:39:21 +0000 (09:39 +0000)
committerDavid Sherwood <david.sherwood@arm.com>
Tue, 11 Jan 2022 09:37:39 +0000 (09:37 +0000)
commit51497dc0b20179eb145820cb8f651f026960de08
tree694147513b6631843f8f3586cfce02a2e2a65be3
parent22ac067b2dce8c90db0bbeecb6ec926f526399df
[IR] Change vector.splice intrinsic to reject out-of-bounds indices

I've changed the definition of the experimental.vector.splice
instrinsic to reject indices that are known to be or possibly
out-of-bounds. In practice, this means changing the definition so that
the index is now only valid in the range [-VL, VL-1] where VL is the
known minimum vector length. We use the vscale_range attribute to
take the minimum vscale value into account so that we can permit
more indices when the attribute is present.

The splice intrinsic is currently only ever generated by the vectoriser,
which will never attempt to splice vectors with out-of-bounds values.
Changing the definition also makes things simpler for codegen since we
can always assume that the index is valid.

This patch was created in response to review comments on D115863

Differential Revision: https://reviews.llvm.org/D115933
llvm/docs/LangRef.rst
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/IR/Verifier.cpp
llvm/test/CodeGen/AArch64/named-vector-shuffles-neon.ll
llvm/test/CodeGen/AArch64/named-vector-shuffles-sve.ll
llvm/test/Verifier/invalid-splice.ll [new file with mode: 0644]