[PATCH] D92715: [Clang][RISCV] Define RISC-V V builtin types

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 7 16:04:00 PST 2021


erichkeane added a comment.

In D92715#2446479 <https://reviews.llvm.org/D92715#2446479>, @craig.topper wrote:

> I think it would be possible to add a new attribute to define these types. But only specific values for parameters would be allowed so that it could only generate the exact types we see here and the future segment load patches. It wouldn't be general purpose like vector_size since the backend design has a contract about how to translate the LMUL value from the scalable type.
>
> This would introduce a new type in the AST or at least new subtype of VectorType. This new type would need to be checked for in multiple places in the compiler to define its behavior. As a datapoint VectorType::SveFixedLengthDataVector appears 20 times. It's not clear that's a reduction in complexity versus following what was already done with AArch64SVEACLETypes.def. But I'm not a frontend expert.

FWIW, when I went to introduce the predecessor to _ExtInt, @rsmith was very against using an attribute spelling and wanted a declaration keyword (which is partly how _ExtInt ended up how it was).

I don't think it is controversial to be a new AST type however.


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

https://reviews.llvm.org/D92715



More information about the cfe-commits mailing list