-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[Clang][Sema] Extend test coverage for SVE/SME builtin usage. #156908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds SEMA tests to verify correct SVE/SME builtin usage based on the calling function's type (i.e. normal, streaming or streaming compatible). For invalid uses the tests verify the expected diagnostic is emitted. This exposed an issue whereby some builtins are incorrectly callable by streaming compatible functions, which this PR fixes. The tests are autogenerated based on the builtin definitions (e.g. arm_sve.td). This is achieved by extending SVEEmitter, which can now emit a JSON file containing builtin usage information that can be fed to aarch64_builtins_test_generator.py that is also part of this PR.
@llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-aarch64 Author: Paul Walker (paulwalker-arm) ChangesAdds SEMA tests to verify correct SVE/SME builtin usage based on the calling function's type (i.e. normal, streaming or streaming compatible). For invalid uses the tests verify the expected diagnostic is emitted. This exposed an issue whereby some builtins are incorrectly callable by streaming compatible functions, which this PR fixes. The tests are autogenerated based on the builtin definitions (e.g. arm_sve.td). This is achieved by extending SVEEmitter, which can now emit a JSON file containing builtin usage information that can be fed to aarch64_builtins_test_generator.py that is also part of this PR. Everything currently in
Patch is 4.27 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/156908.diff 68 Files Affected:
diff --git a/clang/include/clang/Basic/CMakeLists.txt b/clang/include/clang/Basic/CMakeLists.txt
index 81736006a21a0..cfd165e6fa7e1 100644
--- a/clang/include/clang/Basic/CMakeLists.txt
+++ b/clang/include/clang/Basic/CMakeLists.txt
@@ -159,6 +159,9 @@ clang_tablegen(arm_mve_builtin_aliases.inc -gen-arm-mve-builtin-aliases
clang_tablegen(arm_sve_builtins.inc -gen-arm-sve-builtins
SOURCE arm_sve.td
TARGET ClangARMSveBuiltins)
+clang_tablegen(arm_sve_builtins.json -gen-arm-sve-builtins-json
+ SOURCE arm_sve.td
+ TARGET ClangARMSveBuiltinsJSON)
clang_tablegen(arm_sve_builtin_cg.inc -gen-arm-sve-builtin-codegen
SOURCE arm_sve.td
TARGET ClangARMSveBuiltinCG)
@@ -174,6 +177,9 @@ clang_tablegen(arm_sve_streaming_attrs.inc -gen-arm-sve-streaming-attrs
clang_tablegen(arm_sme_builtins.inc -gen-arm-sme-builtins
SOURCE arm_sme.td
TARGET ClangARMSmeBuiltins)
+clang_tablegen(arm_sme_builtins.json -gen-arm-sme-builtins-json
+ SOURCE arm_sme.td
+ TARGET ClangARMSmeBuiltinsJSON)
clang_tablegen(arm_sme_builtin_cg.inc -gen-arm-sme-builtin-codegen
SOURCE arm_sme.td
TARGET ClangARMSmeBuiltinCG)
diff --git a/clang/lib/Sema/SemaARM.cpp b/clang/lib/Sema/SemaARM.cpp
index e09c35296ef3b..1c7c832d7edfa 100644
--- a/clang/lib/Sema/SemaARM.cpp
+++ b/clang/lib/Sema/SemaARM.cpp
@@ -603,8 +603,8 @@ static bool checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall,
bool SatisfiesSME = Builtin::evaluateRequiredTargetFeatures(
StreamingBuiltinGuard, CallerFeatures);
- if ((SatisfiesSVE && SatisfiesSME) ||
- (SatisfiesSVE && FnType == SemaARM::ArmStreamingCompatible))
+ if (SatisfiesSVE && SatisfiesSME)
+ // Function type is irrelevant for streaming-agnostic builtins.
return false;
else if (SatisfiesSVE)
BuiltinType = SemaARM::ArmNonStreaming;
diff --git a/clang/test/CodeGen/AArch64/sve2-intrinsics/acle_sve2_rax1.c b/clang/test/CodeGen/AArch64/sve2-intrinsics/acle_sve2_rax1.c
index 42bc37b9ef17c..480d4e4744f0a 100644
--- a/clang/test/CodeGen/AArch64/sve2-intrinsics/acle_sve2_rax1.c
+++ b/clang/test/CodeGen/AArch64/sve2-intrinsics/acle_sve2_rax1.c
@@ -1,10 +1,9 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
-// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -target-feature +sme2 -target-feature +sme2p1 -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sme2p1 -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
-// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
-// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve2 -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
+// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -target-feature +sme2p1 -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
+// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -target-feature +sve-sha3 -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
// REQUIRES: aarch64-registered-target
diff --git a/clang/test/Sema/AArch64/arm_sme_streaming_compatible_sme.c b/clang/test/Sema/AArch64/arm_sme_streaming_compatible_sme.c
new file mode 100644
index 0000000000000..f695e278d91ad
--- /dev/null
+++ b/clang/test/Sema/AArch64/arm_sme_streaming_compatible_sme.c
@@ -0,0 +1,48 @@
+// NOTE: File has been autogenerated by utils/aarch64_builtins_test_generator.py
+// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -verify
+// expected-no-diagnostics
+
+// REQUIRES: aarch64-registered-target
+
+#include <arm_sme.h>
+
+// Properties: guard="" streaming_guard="sme" flags="streaming-compatible,requires-za"
+
+void test(void) __arm_inout("za"){
+ int64_t int64_t_val;
+ uint32_t uint32_t_val;
+ void * void_ptr_val;
+
+ svldr_vnum_za(uint32_t_val, void_ptr_val, int64_t_val);
+ svldr_za(uint32_t_val, void_ptr_val);
+ svstr_vnum_za(uint32_t_val, void_ptr_val, int64_t_val);
+ svstr_za(uint32_t_val, void_ptr_val);
+ svzero_mask_za(2);
+ svzero_za();
+}
+
+void test_streaming(void) __arm_streaming __arm_inout("za"){
+ int64_t int64_t_val;
+ uint32_t uint32_t_val;
+ void * void_ptr_val;
+
+ svldr_vnum_za(uint32_t_val, void_ptr_val, int64_t_val);
+ svldr_za(uint32_t_val, void_ptr_val);
+ svstr_vnum_za(uint32_t_val, void_ptr_val, int64_t_val);
+ svstr_za(uint32_t_val, void_ptr_val);
+ svzero_mask_za(2);
+ svzero_za();
+}
+
+void test_streaming_compatible(void) __arm_streaming_compatible __arm_inout("za"){
+ int64_t int64_t_val;
+ uint32_t uint32_t_val;
+ void * void_ptr_val;
+
+ svldr_vnum_za(uint32_t_val, void_ptr_val, int64_t_val);
+ svldr_za(uint32_t_val, void_ptr_val);
+ svstr_vnum_za(uint32_t_val, void_ptr_val, int64_t_val);
+ svstr_za(uint32_t_val, void_ptr_val);
+ svzero_mask_za(2);
+ svzero_za();
+}
diff --git a/clang/test/Sema/AArch64/arm_sme_streaming_compatible_sme_AND_sme2.c b/clang/test/Sema/AArch64/arm_sme_streaming_compatible_sme_AND_sme2.c
new file mode 100644
index 0000000000000..ea17ab9c6a5d0
--- /dev/null
+++ b/clang/test/Sema/AArch64/arm_sme_streaming_compatible_sme_AND_sme2.c
@@ -0,0 +1,33 @@
+// NOTE: File has been autogenerated by utils/aarch64_builtins_test_generator.py
+// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -verify
+// expected-no-diagnostics
+
+// REQUIRES: aarch64-registered-target
+
+#include <arm_sme.h>
+
+// Properties: guard="" streaming_guard="sme,sme2" flags="streaming-compatible,requires-zt"
+
+void test(void) __arm_inout("zt0"){
+ void * void_ptr_val;
+
+ svldr_zt(0, void_ptr_val);
+ svstr_zt(0, void_ptr_val);
+ svzero_zt(0);
+}
+
+void test_streaming(void) __arm_streaming __arm_inout("zt0"){
+ void * void_ptr_val;
+
+ svldr_zt(0, void_ptr_val);
+ svstr_zt(0, void_ptr_val);
+ svzero_zt(0);
+}
+
+void test_streaming_compatible(void) __arm_streaming_compatible __arm_inout("zt0"){
+ void * void_ptr_val;
+
+ svldr_zt(0, void_ptr_val);
+ svstr_zt(0, void_ptr_val);
+ svzero_zt(0);
+}
diff --git a/clang/test/Sema/AArch64/arm_sme_streaming_only_sme.c b/clang/test/Sema/AArch64/arm_sme_streaming_only_sme.c
new file mode 100644
index 0000000000000..29bc3aab3f9c6
--- /dev/null
+++ b/clang/test/Sema/AArch64/arm_sme_streaming_only_sme.c
@@ -0,0 +1,1491 @@
+// NOTE: File has been autogenerated by utils/aarch64_builtins_test_generator.py
+// RUN: %clang_cc1 %s -fsyntax-only -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sve -verify=streaming-guard
+
+// REQUIRES: aarch64-registered-target
+
+#include <arm_sme.h>
+
+// Properties: guard="" streaming_guard="sme" flags="streaming-only,requires-za"
+
+void test(void) __arm_inout("za"){
+ int64_t int64_t_val;
+ svbfloat16_t svbfloat16_t_val;
+ svbool_t svbool_t_val;
+ svfloat16_t svfloat16_t_val;
+ svfloat32_t svfloat32_t_val;
+ svfloat64_t svfloat64_t_val;
+ svint8_t svint8_t_val;
+ svint16_t svint16_t_val;
+ svint32_t svint32_t_val;
+ svint64_t svint64_t_val;
+ svmfloat8_t svmfloat8_t_val;
+ svuint8_t svuint8_t_val;
+ svuint16_t svuint16_t_val;
+ svuint32_t svuint32_t_val;
+ svuint64_t svuint64_t_val;
+ uint32_t uint32_t_val;
+ void * void_ptr_val;
+
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddha_za32_m(2, svbool_t_val, svbool_t_val, svint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddha_za32_m(2, svbool_t_val, svbool_t_val, svuint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddha_za32_s32_m(2, svbool_t_val, svbool_t_val, svint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddha_za32_u32_m(2, svbool_t_val, svbool_t_val, svuint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddva_za32_m(2, svbool_t_val, svbool_t_val, svint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddva_za32_m(2, svbool_t_val, svbool_t_val, svuint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddva_za32_s32_m(2, svbool_t_val, svbool_t_val, svint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svaddva_za32_u32_m(2, svbool_t_val, svbool_t_val, svuint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_vnum_za8(0, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_vnum_za16(1, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_vnum_za32(2, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_vnum_za64(2, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_vnum_za128(2, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_za8(0, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_za16(1, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_za32(2, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_za64(2, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_hor_za128(2, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_vnum_za8(0, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_vnum_za16(1, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_vnum_za32(2, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_vnum_za64(2, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_vnum_za128(2, uint32_t_val, svbool_t_val, void_ptr_val, int64_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_za8(0, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_za16(1, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_za32(2, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_za64(2, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svld1_ver_za128(2, uint32_t_val, svbool_t_val, void_ptr_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_bf16_m(2, svbool_t_val, svbool_t_val, svbfloat16_t_val, svbfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_f16_m(2, svbool_t_val, svbool_t_val, svfloat16_t_val, svfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_f32_m(2, svbool_t_val, svbool_t_val, svfloat32_t_val, svfloat32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_m(2, svbool_t_val, svbool_t_val, svbfloat16_t_val, svbfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_m(2, svbool_t_val, svbool_t_val, svfloat16_t_val, svfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_m(2, svbool_t_val, svbool_t_val, svfloat32_t_val, svfloat32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_m(2, svbool_t_val, svbool_t_val, svint8_t_val, svint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_m(2, svbool_t_val, svbool_t_val, svuint8_t_val, svuint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_s8_m(2, svbool_t_val, svbool_t_val, svint8_t_val, svint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmopa_za32_u8_m(2, svbool_t_val, svbool_t_val, svuint8_t_val, svuint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_bf16_m(2, svbool_t_val, svbool_t_val, svbfloat16_t_val, svbfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_f16_m(2, svbool_t_val, svbool_t_val, svfloat16_t_val, svfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_f32_m(2, svbool_t_val, svbool_t_val, svfloat32_t_val, svfloat32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_m(2, svbool_t_val, svbool_t_val, svbfloat16_t_val, svbfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_m(2, svbool_t_val, svbool_t_val, svfloat16_t_val, svfloat16_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_m(2, svbool_t_val, svbool_t_val, svfloat32_t_val, svfloat32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_m(2, svbool_t_val, svbool_t_val, svint8_t_val, svint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_m(2, svbool_t_val, svbool_t_val, svuint8_t_val, svuint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_s8_m(2, svbool_t_val, svbool_t_val, svint8_t_val, svint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svmops_za32_u8_m(2, svbool_t_val, svbool_t_val, svuint8_t_val, svuint8_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za8_m(svint8_t_val, svbool_t_val, 0, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za8_m(svmfloat8_t_val, svbool_t_val, 0, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za8_m(svuint8_t_val, svbool_t_val, 0, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za8_mf8_m(svmfloat8_t_val, svbool_t_val, 0, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za8_s8_m(svint8_t_val, svbool_t_val, 0, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za8_u8_m(svuint8_t_val, svbool_t_val, 0, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_bf16_m(svbfloat16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_f16_m(svfloat16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_m(svbfloat16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_m(svfloat16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_m(svint16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_m(svuint16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_s16_m(svint16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za16_u16_m(svuint16_t_val, svbool_t_val, 1, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za32_f32_m(svfloat32_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za32_m(svfloat32_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za32_m(svint32_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za32_m(svuint32_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za32_s32_m(svint32_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za32_u32_m(svuint32_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za64_f64_m(svfloat64_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za64_m(svfloat64_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za64_m(svint64_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za64_m(svuint64_t_val, svbool_t_val, 2, uint32_t_val);
+ // streaming-guard-error@+1 {{builtin can only be called from a streaming function}}
+ svread_hor_za64_s64_m(svint64_t_val, svbool_t_val, 2, uint32_t_val);
...
[truncated]
|
✅ With the latest revision this PR passed the Python code formatter. |
1d2952a
to
418c118
Compare
Adds SEMA tests to verify correct SVE/SME builtin usage based on the calling function's type (i.e. normal, streaming or streaming compatible).
For invalid uses the tests verify the expected diagnostic is emitted. This exposed an issue whereby some builtins are incorrectly callable by streaming compatible functions, which this PR fixes.
The tests are autogenerated based on the builtin definitions (e.g. arm_sve.td). This is achieved by extending SVEEmitter, which can now emit a JSON file containing builtin usage information that can be fed to aarch64_builtins_test_generator.py that is also part of this PR.
Everything currently in
clang/test/Sema/AArch64
is the result of: