[cfe-dev] VectorType supported sizes

Sam McCall via cfe-dev cfe-dev at lists.llvm.org
Thu Apr 2 08:28:29 PDT 2020

Sent https://reviews.llvm.org/D77313 - I was guessing as to reviewers, feel
free to jump on this (especially) if you know something about this topic.

On Thu, Apr 2, 2020 at 1:51 PM Sam McCall <sammccall at google.com> wrote:

> Hi folks,
> VectorType supports arbitrary vector sizes up to 2047, and nothing above
> that.
> GCC supports sizes up to 2**62, but only powers of 2.
> Would it make sense to support e.g. arbitrary sizes up to 256, and powers
> of two above that?
> I'm not familiar with all the ways vector types are used, but want to
> reduce pressure on the size of the bitfields.
> Currently VectorType stores its size in "all the remaining bits" left by
> Type.
> This was 11 bits, so clang supported sizes <2048. We accidentally
> regressed this to 10 bits <1024 in 6f428e09 when adding another bit to
> Type, and it turns out people have code with vector_size(1024).
> https://bugs.llvm.org/show_bug.cgi?id=45387
> If it would be useful, my proposal is to store a "largesize" flag and an
> 8-bit size. If largesize is set then the real size is 1<<size. This would
> save an additional bit and support big sizes.
> If that _doesn't_ make sense, I'd probably just start treating size=0 as
> 1024, with the assumption that nobody was making use of sizes 1025-2043.
> Cheers, Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200402/ce38162b/attachment.html>

More information about the cfe-dev mailing list