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

Graham Hunter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 08:11:00 PDT 2019


huntergr added a comment.

In D32530#1487868 <https://reviews.llvm.org/D32530#1487868>, @cameron.mcinally wrote:

> Sorry to be late to the party, but I have a quick question:
>
> > Ok, so do we have agreement that constant literal indices should be limited to 0..n-1 for now, but non-constant indices can potentially exceed n so that expressions featuring vscale can be used?
>
> What if we know the width is fixed on our target machine? Let's say it's fixed at 512b. So a full width scalable double vector would be:
>
> `<vscale x 2 x double>`
>
> Since our width is fixed, we know that vscale=4 here and there are 8 elements in this vector.
>
> I'd like to be able to do a really fast insert at say index 3. I.e. `insert_element(<vscale x 2 x double> res, double elt, int 3)`. Would that insert be as fast with the vscale method as it would be for an index < n-1?


If you know the exact size of your vectors at compile time, then I believe fixed length vector types should be used, at least at the IR level.

The performance of insert/extract is target dependent. For SVE you almost always need a predicate for a single element insert or extract, so you're not going to gain anything by knowing the size ahead of time.


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

https://reviews.llvm.org/D32530





More information about the llvm-commits mailing list