This is an archive of the discontinued LLVM Phabricator instance.

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

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

Details

Summary

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

https://developer.arm.com/docs/100987/0000/arm-c-language-extensions-for-sve

or the email message:

http://lists.llvm.org/pipermail/cfe-dev/2019-June/062523.html

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:

https://gcc.gnu.org/ml/gcc/2019-11/msg00092.html

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.