[PATCH] D32530: [SVE][IR] Scalable Vector IR Type

Graham Hunter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 02:38:08 PDT 2019


huntergr added a comment.

In D32530#1470773 <https://reviews.llvm.org/D32530#1470773>, @greened wrote:

> > We need to clarify on insertelement/extractelement. Maybe already done in some other patches, but that clarification should be part of this patch.
> >  Is the "length of val" under the semantics "scalable * n" in <scalable n x ElemTy>, right? Or is it still n?
>
> I am not sure how it could be anything but `n`.  If you don't know how long the vector is, you can't correctly generate an index beyond `n`.  I assume for vectors of length > n one would have to use `shufflevector` or something similar (using `vscale` and `stepvector` as Graham mentioned) to get the elements you want to the lower `n` positions.
>
> Either way, the semantics and any restrictions certainly need to be documented.


For now, I suspect keeping the limit as 'n' is sufficient, as we only really need to insert into the first element to be able to generate a splat. If we need more later we can discuss it then.

> 
> 
>> Going with length of val being "scalable * n", if there is an optimization that takes advantages of poison value being returned by evaluating "idx >= n" at compile time, we need to disable that for scalable vector. Also, if any verifier is checking whether constant idx value is less than n, we need to disable that for scalable vector.
> 
> If the index is still restricted by `n` then this shouldn't be an issue.

Agreed.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D32530/new/

https://reviews.llvm.org/D32530





More information about the llvm-commits mailing list