[PATCH] D127762: [Clang][AArch64] Add ACLE attributes for SME.

Sander de Smalen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 09:33:01 PDT 2022


sdesmalen created this revision.
sdesmalen added reviewers: paulwalker-arm, aaron.ballman, aemerson, t.p.northover.
Herald added subscribers: jdoerfert, kristof.beyls.
Herald added a project: All.
sdesmalen requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch adds all the language-level function attributes defined in:

  https://github.com/ARM-software/acle/pull/188

The attributes are used to control PSTATE.ZA and PSTATE.SM, which are
respectively used for enabling the use of the ZA matrix array and
Streaming mode. This information needs to be available on call sites,
since the use of ZA or streaming mode may have to be enabled or disabled
around the call-site (depending on the attributes set on the caller and the
callee). For calls to functions from a function pointer, there is no IR
declaration available, so the attributes must be added explicitly to the
call-site.

With the exception of 'arm_locally_streaming', the information is part of
the function's interface, not just the function definition, and thus needs
to be propagated through the FunctionProtoType::ExtProtoInfo.

This patch adds the defintions of these attributes, as well as semantic
analysis to ensure conversions between function pointers are valid and
that no conflicting attributes are set. For example, 'arm_streaming' and
'arm_streaming_compatible' are mutually exclusive.

LLVM support for these attributes will follow later, so at the moment
these attributes are non-functional.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127762

Files:
  clang/include/clang/AST/Type.h
  clang/include/clang/AST/TypeProperties.td
  clang/include/clang/Basic/Attr.td
  clang/lib/AST/Type.cpp
  clang/lib/AST/TypePrinter.cpp
  clang/lib/Basic/Targets/AArch64.cpp
  clang/lib/Basic/Targets/AArch64.h
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/CodeGen/aarch64-sme-intrinsics/aarch64-sme-attrs.c
  clang/test/Misc/pragma-attribute-supported-attributes-list.test
  clang/test/Sema/aarch64-sme-attrs-no-sme.c
  clang/test/Sema/aarch64-sme-attrs-on-x86.c
  clang/test/Sema/aarch64-sme-func-attrs.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127762.436823.patch
Type: text/x-patch
Size: 43332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220614/ca110a88/attachment-0001.bin>


More information about the cfe-commits mailing list