[PATCH] D27105: [Constants] Add "stepvector" to represent the sequence 0, 1, 2, 3... [IR support for SVE scalable vectors 4/4]

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 18 02:43:53 PDT 2017


aemerson added a comment.

In https://reviews.llvm.org/D27105#724054, @rengolin wrote:

> After reading the SVE docs, I realised that what I requested here (start + step) is exactly what SVE has for the INDEX instruction. I don't think that having a constant step in this way makes sense, even for SVE.
>
> I mean, once could write:
>
>   INDEX z0.s, #1, #2
>   
>
> as
>
>   %a = splat <n x 4 x i32>, %i32 2
>   %b = mul <n x 4 x i32> stepvector <n x 4 x i32>, %a
>   
>
> But what about when `start != 1`?
>
> I retain the position that an intrinsic here would be much better with start/step and would minimise the changes to IR, at least for now.
>
> cheers,
> --renato


An arbitrary start value can be expressed by adding a splat of the start value to the step vector sequence. Composing that with the multiplication of the stepvector to achieve arbitrary steps values covers all use cases of seriesvector.


https://reviews.llvm.org/D27105





More information about the llvm-commits mailing list