[PATCH] D127762: [Clang][AArch64] Add/implement ACLE keywords for SME.

Sander de Smalen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 5 03:32:19 PDT 2023


sdesmalen updated this revision to Diff 528366.
sdesmalen retitled this revision from "[Clang][AArch64] Add ACLE attributes for SME." to "[Clang][AArch64] Add/implement ACLE keywords for SME.".
sdesmalen edited the summary of this revision.
sdesmalen added a comment.

- Rebased patch after patch to add RegularKeyword attributes (D148702 <https://reviews.llvm.org/D148702>) landed
- Split off the request to reduce the size of FunctionTypeExtraBitfields (and use alignment of the struct to pointer type) to a new patch: D152140 <https://reviews.llvm.org/D152140>
- Added test to ensure that the serialization of type attributes is exported/imported to/from modules, see clang/test/Modules/aarch64-sme-keywords.cppm
- Added some new tests for template instantiation and function overloading with SME attributes:

  void normal_func(void) {}
  void streaming_func(void) __arm_streaming {}
  
  template<typename T> int test_templated_f(T);
  template<> constexpr int test_templated_f<void(*)(void)>(void(*)(void)) { return 1; }
  template<> constexpr int test_templated_f<void(*)(void)__arm_streaming>(void(*)(void)__arm_streaming) { return 2; }
  
  static_assert(test_templated_f(&normal_func) == 1, "Instantiated to wrong function");
  static_assert(test_templated_f(&streaming_func) == 2, "Instantiated to wrong function");

and

  // expected-cpp-error at +2 {{'__arm_streaming' only applies to function types; type here is 'int'}}
  // expected-error at +1 {{'__arm_streaming' only applies to function types; type here is 'int'}}
  int invalid_type_for_attribute __arm_streaming;
  
  // Test overloads
  constexpr int overload(void f(void)) { return 1; }
  constexpr int overload(void f(void) __arm_streaming) { return 2; }
  static_assert(overload(&normal_func) == 1, "Overloaded to wrong function");
  static_assert(overload(&streaming_func) == 2, "Overloaded to wrong function");


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127762/new/

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/include/clang/Basic/AttrDocs.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/Type.cpp
  clang/lib/AST/TypePrinter.cpp
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/lib/Sema/SemaDeclCXX.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/lib/Sema/SemaType.cpp
  clang/test/AST/ast-dump-sme-attributes.cpp
  clang/test/CodeGen/aarch64-sme-intrinsics/aarch64-sme-attrs.cpp
  clang/test/Modules/aarch64-sme-keywords.cppm
  clang/test/Sema/aarch64-sme-func-attrs.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127762.528366.patch
Type: text/x-patch
Size: 62435 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230605/6f2ff70e/attachment-0001.bin>


More information about the cfe-commits mailing list