[PATCH] D157269: [Clang][AArch64] Diagnostics for SME attributes when target doesn't have 'sme'

Sander de Smalen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 7 03:31:36 PDT 2023


sdesmalen created this revision.
sdesmalen added reviewers: rsandifo-arm, aaron.ballman.
Herald added subscribers: ctetreau, hiraditya, kristof.beyls.
Herald added a project: All.
sdesmalen requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

This patch adds error diagnostics to Clang when code uses the AArch64 SME
attributes without specifying 'sme' as available target attribute.

- Function definitions marked as '__arm_streaming', '__arm_locally_streaming', '__arm_shared_za' or '__arm_new_za' will by definition use or require SME instructions.
- Calls from non-streaming functions to streaming-functions require the compiler to enable/disable streaming-SVE mode around the call-site.

In some cases we can accept the SME attributes without having 'sme' enabled:

- Function declaration can have the SME attributes.
- Definitions can be __arm_streaming_compatible since the generated code should execute on processing elements without SME.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157269

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaChecking.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/test/Sema/aarch64-sme-func-attrs-without-target-feature.cpp
  llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
  llvm/test/CodeGen/AArch64/sme-call-streaming-compatible-to-normal-fn-wihout-sme-attr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157269.547698.patch
Type: text/x-patch
Size: 9097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230807/28ef3771/attachment.bin>


More information about the cfe-commits mailing list