[PATCH] D85128: [Prototype][SVE] Support arm_sve_vector_bits attribute

Cullen Rhodes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 4 03:03:46 PDT 2020


c-rhodes added a comment.

In D85128#2191108 <https://reviews.llvm.org/D85128#2191108>, @tschuett wrote:

> Stupid questions.
>
> - Is it for convenience? You get arrays, global variables, structs, ... . Vectorization becomes easier ...

Yes, this allows the definition of types that can be used in constructs sizeless types cannot. In earlier revisions of the ACLE there was the concept of sizeless structs defined by a `__sizeless_struct` keyword that could have members of sizeless type in addition to members of sized type, although there was push back on the idea of sizeless aggregates in general and that idea was dropped. If you're interested in the background there's more information here [1][2].

[1] https://gcc.gnu.org/legacy-ml/gcc/2019-11/msg00088.html
[2] https://gcc.gnu.org/legacy-ml/gcc-patches/2018-10/msg00868.html

> - Are there any potential performance benefits over scalable vectors?

If VLSTs are represented as fixed-length vectors in LLVM as they are in this prototype then hopefully we can take advantage of existing optimisations, although I think there is work to be done there especially around the interaction with scalable vectors and supporting those in existing passes. This patch required a few changes to existing passes to bail out for scalable vectors so we're already hitting parts of the codebase we've yet to hit that would be good candidates for optimisation work. This also ties into the fixed-length code generation work @paulwalker-arm has been doing which is still early days. I'm not sure if that answers your question, but ultimately the compiler should have more information about these types given the vector size is explicit so it should be able to do a better job at optimisation.

> - Is it compatible with GCC?

Support for this attribute landed in GCC 10 and it's more complete than what this patch implements. We've yet to implement the behaviour guarded by the `__ARM_FEATURE_SVE_VECTOR_OPERATORS` and `__ARM_FEATURE_SVE_PREDICATE_OPERATORS` feature macros, so the GNU `__attribute__((vector_size))` extension is not available and operators such as binary '+' are not supported for VLSTs. Support for this is intended to be addressed by later patches.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85128



More information about the cfe-commits mailing list