Page MenuHomePhabricator

[AST][SVE] Add new Type queries for sizeless types

Authored by rsandifo-arm on Mar 3 2020, 2:34 PM.



One of the defining features of the SVE ACLE types is that they
are "sizeless"; see the SVE ACLE spec:

or the email message:

for a fuller definition of what that means.

This patch adds two associated type queries:

  • isSizelessBuiltinType asks specifically about types that are built into clang. It is effectively an enum range check.
  • isSizelessType instead tests for any type that has the "sizeless" type property. At the moment it only returns true for the built-in types, but it seems better not to hard-code that assumption throughout the codebase. (E.g. we could in principle support some form of user-defined sizeless types in future. Even if that seems unlikely and never actually happens, the possibility at least exists.)

Diff Detail

Event Timeline

rsandifo-arm created this revision.Mar 3 2020, 2:34 PM
Herald added a project: Restricted Project. · View Herald Transcript

At the moment the queries just return true for SVE types, so an obvious alternative would be to check specifically for SVE types. The sizeless type concept is more general than that though. E.g. my understanding from:

is that the RVV folks intend to use this too (both for clang and gcc).

Run git-clang-format.

This revision is now accepted and ready to land.Mar 11 2020, 5:54 PM
This revision was automatically updated to reflect the committed changes.