[all-commits] [llvm/llvm-project] ecb7b9: [Clang][AArch64] Diagnostics for SME attributes wh...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Wed Aug 9 05:31:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ecb7b9c5c589b693e8a7351461db5b520be0bc90
      https://github.com/llvm/llvm-project/commit/ecb7b9c5c589b693e8a7351461db5b520be0bc90
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaChecking.cpp
    M clang/lib/Sema/SemaDecl.cpp
    A clang/test/Sema/aarch64-sme-func-attrs-without-target-feature.cpp
    M llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
    M llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
    M llvm/lib/Target/AArch64/SMEInstrFormats.td
    A llvm/test/CodeGen/AArch64/sme-call-streaming-compatible-to-normal-fn-wihout-sme-attr.ll
    M llvm/test/MC/AArch64/SME/directives-negative.s
    M llvm/test/MC/AArch64/SME/smstart.s
    M llvm/test/MC/AArch64/SME/smstop.s
    M llvm/test/MC/AArch64/SME/system-regs.s

  Log Message:
  -----------
  [Clang][AArch64] Diagnostics for SME attributes when target doesn't have 'sme'

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.

Reviewed By: paulwalker-arm

Differential Revision: https://reviews.llvm.org/D157269




More information about the All-commits mailing list