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

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 11:29:23 PDT 2017


rengolin added a comment.

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


https://reviews.llvm.org/D27105





More information about the llvm-commits mailing list