Skip to content

Commit 0eefcaf

Browse files
authored
[Clang][SME] Add IsStreamingOrSVE2p1 (#76975)
This patch adds IsStreamingOrSVE2p1 to the applicable builtins and a warning for when those builtins are not used in a streaming or sve2p1 function.
1 parent 2952fb3 commit 0eefcaf

File tree

19 files changed

+285
-170
lines changed

19 files changed

+285
-170
lines changed

clang/include/clang/Basic/arm_sve.td

Lines changed: 55 additions & 60 deletions
Large diffs are not rendered by default.

clang/include/clang/Basic/arm_sve_sme_incl.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ def IsPreservesZA : FlagType<0x10000000000>;
227227
def IsReadZA : FlagType<0x20000000000>;
228228
def IsWriteZA : FlagType<0x40000000000>;
229229
def IsReductionQV : FlagType<0x80000000000>;
230+
def IsStreamingOrSVE2p1 : FlagType<0x80000000000>; // Use for intrinsics that are common between sme/sme2 and sve2p1.
230231

231232
// These must be kept in sync with the flags in include/clang/Basic/TargetBuiltins.h
232233
class ImmCheckType<int val> {

clang/lib/Basic/Targets/AArch64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
5050
bool HasMatMul = false;
5151
bool HasBFloat16 = false;
5252
bool HasSVE2 = false;
53+
bool HasSVE2p1 = false;
5354
bool HasSVE2AES = false;
5455
bool HasSVE2SHA3 = false;
5556
bool HasSVE2SM4 = false;

clang/lib/Sema/SemaChecking.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2998,7 +2998,12 @@ static QualType getNeonEltType(NeonTypeFlags Flags, ASTContext &Context,
29982998
llvm_unreachable("Invalid NeonTypeFlag!");
29992999
}
30003000

3001-
enum ArmStreamingType { ArmNonStreaming, ArmStreaming, ArmStreamingCompatible };
3001+
enum ArmStreamingType {
3002+
ArmNonStreaming,
3003+
ArmStreaming,
3004+
ArmStreamingCompatible,
3005+
ArmStreamingOrSVE2p1
3006+
};
30023007

30033008
bool Sema::ParseSVEImmChecks(
30043009
CallExpr *TheCall, SmallVector<std::tuple<int, int, int>, 3> &ImmChecks) {
@@ -3156,6 +3161,16 @@ static void checkArmStreamingBuiltin(Sema &S, CallExpr *TheCall,
31563161
const FunctionDecl *FD,
31573162
ArmStreamingType BuiltinType) {
31583163
ArmStreamingType FnType = getArmStreamingFnType(FD);
3164+
if (BuiltinType == ArmStreamingOrSVE2p1) {
3165+
// Check intrinsics that are available in [sve2p1 or sme/sme2].
3166+
llvm::StringMap<bool> CallerFeatureMap;
3167+
S.Context.getFunctionFeatureMap(CallerFeatureMap, FD);
3168+
if (Builtin::evaluateRequiredTargetFeatures("sve2p1", CallerFeatureMap))
3169+
BuiltinType = ArmStreamingCompatible;
3170+
else
3171+
BuiltinType = ArmStreaming;
3172+
}
3173+
31593174
if (FnType == ArmStreaming && BuiltinType == ArmNonStreaming) {
31603175
S.Diag(TheCall->getBeginLoc(), diag::warn_attribute_arm_sm_incompat_builtin)
31613176
<< TheCall->getSourceRange() << "streaming";

clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_revd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
22
// REQUIRES: aarch64-registered-target
33
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \
4-
// RUN: -target-feature +sme -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
4+
// RUN: -target-feature +sme2 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
55
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu \
66
// RUN: -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
77
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu \
88
// RUN: -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
99
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu \
1010
// RUN: -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
1111
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature +bf16 -S -disable-O0-optnone -Werror -o /dev/null %s
12-
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +bf16 -S -disable-O0-optnone -Werror -o /dev/null %s
12+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -target-feature +bf16 -S -disable-O0-optnone -Werror -o /dev/null %s
1313
#include <arm_sve.h>
1414

1515
#ifdef SVE_OVERLOADED_FORMS

clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_bfmlsl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
// REQUIRES: aarch64-registered-target
33

44
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
5-
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sme2 -target-feature +sve -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
5+
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
66
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
77
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sme2 -target-feature +sve -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
88
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s
99
// RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -p mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
10-
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve2p1 -target-feature -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
11-
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sme2 -target-feature +sve -target-feature -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -o /dev/null %s
10+
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve2p1 -disable-O0-optnone -Werror -Wall -o /dev/null %s
11+
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sme2 -DTEST_SME2 -disable-O0-optnone -Werror -Wall -o /dev/null %s
1212

1313
#include <arm_sve.h>
1414

1515
#ifndef TEST_SME2
1616
#define ATTR
1717
#else
18-
#define ATTR __arm_streaming_compatible
18+
#define ATTR __arm_streaming
1919
#endif
2020

2121
#ifdef SVE_OVERLOADED_FORMS

clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_cntp.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@
33
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
44
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
55
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
6-
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
6+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme2 -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -o /dev/null %s
7+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -O1 -Werror -emit-llvm -o - %s | FileCheck %s
8+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
9+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -o /dev/null %s
710

811
#include <arm_sve.h>
912

13+
#ifndef TEST_SME2
14+
#define ATTR
15+
#else
16+
#define ATTR __arm_streaming
17+
#endif
18+
1019
// CHECK-LABEL: @test_svcntp_c8_vlx2(
1120
// CHECK-NEXT: entry:
1221
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 2)
@@ -17,7 +26,7 @@
1726
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 2)
1827
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
1928
//
20-
uint64_t test_svcntp_c8_vlx2(svcount_t pnn) {
29+
uint64_t test_svcntp_c8_vlx2(svcount_t pnn) ATTR {
2130
return svcntp_c8(pnn, 2);
2231
}
2332

@@ -31,7 +40,7 @@ uint64_t test_svcntp_c8_vlx2(svcount_t pnn) {
3140
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 4)
3241
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
3342
//
34-
uint64_t test_svcntp_c8_vlx4(svcount_t pnn) {
43+
uint64_t test_svcntp_c8_vlx4(svcount_t pnn) ATTR {
3544
return svcntp_c8(pnn, 4);
3645
}
3746

@@ -45,7 +54,7 @@ uint64_t test_svcntp_c8_vlx4(svcount_t pnn) {
4554
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 2)
4655
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
4756
//
48-
uint64_t test_svcntp_c16_vlx2(svcount_t pnn) {
57+
uint64_t test_svcntp_c16_vlx2(svcount_t pnn) ATTR {
4958
return svcntp_c16(pnn, 2);
5059
}
5160

@@ -59,7 +68,7 @@ uint64_t test_svcntp_c16_vlx2(svcount_t pnn) {
5968
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 4)
6069
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
6170
//
62-
uint64_t test_svcntp_c16_vlx4(svcount_t pnn) {
71+
uint64_t test_svcntp_c16_vlx4(svcount_t pnn) ATTR {
6372
return svcntp_c16(pnn, 4);
6473
}
6574

@@ -73,7 +82,7 @@ uint64_t test_svcntp_c16_vlx4(svcount_t pnn) {
7382
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 2)
7483
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
7584
//
76-
uint64_t test_svcntp_c32_vlx2(svcount_t pnn) {
85+
uint64_t test_svcntp_c32_vlx2(svcount_t pnn) ATTR {
7786
return svcntp_c32(pnn, 2);
7887
}
7988

@@ -87,7 +96,7 @@ uint64_t test_svcntp_c32_vlx2(svcount_t pnn) {
8796
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 4)
8897
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
8998
//
90-
uint64_t test_svcntp_c32_vlx4(svcount_t pnn) {
99+
uint64_t test_svcntp_c32_vlx4(svcount_t pnn) ATTR {
91100
return svcntp_c32(pnn, 4);
92101
}
93102

@@ -101,7 +110,7 @@ uint64_t test_svcntp_c32_vlx4(svcount_t pnn) {
101110
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 2)
102111
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
103112
//
104-
uint64_t test_svcntp_c64_vlx2(svcount_t pnn) {
113+
uint64_t test_svcntp_c64_vlx2(svcount_t pnn) ATTR {
105114
return svcntp_c64(pnn, 2);
106115
}
107116

@@ -115,6 +124,6 @@ uint64_t test_svcntp_c64_vlx2(svcount_t pnn) {
115124
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 4)
116125
// CPP-CHECK-NEXT: ret i64 [[TMP0]]
117126
//
118-
uint64_t test_svcntp_c64_vlx4(svcount_t pnn) {
127+
uint64_t test_svcntp_c64_vlx4(svcount_t pnn) ATTR {
119128
return svcntp_c64(pnn, 4);
120129
}

clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_fclamp.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@
1111
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sve2p1 \
1212
// RUN: -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
1313
// RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64-none-linux-gnu -target-feature +sme2 -target-feature +sve \
14-
// RUN: -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
14+
// RUN: -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -o /dev/null %s
1515

1616
#include <arm_sve.h>
1717

18+
#ifndef TEST_SME2
19+
#define ATTR
20+
#else
21+
#define ATTR __arm_streaming
22+
#endif
23+
1824
#ifdef SVE_OVERLOADED_FORMS
1925
// A simple used,unused... macro, long enough to represent any SVE builtin.
2026
#define SVE_ACLE_FUNC(A1, A2_UNUSED, A3, A4_UNUSED) A1##A3
@@ -32,7 +38,7 @@
3238
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.fclamp.nxv8f16(<vscale x 8 x half> [[OP1:%.*]], <vscale x 8 x half> [[OP2:%.*]], <vscale x 8 x half> [[OP3:%.*]])
3339
// CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP0]]
3440
//
35-
svfloat16_t test_svclamp_f16(svfloat16_t op1, svfloat16_t op2, svfloat16_t op3) {
41+
svfloat16_t test_svclamp_f16(svfloat16_t op1, svfloat16_t op2, svfloat16_t op3) ATTR {
3642
return SVE_ACLE_FUNC(svclamp, _f16, , )(op1, op2, op3);
3743
}
3844

@@ -46,7 +52,7 @@ svfloat16_t test_svclamp_f16(svfloat16_t op1, svfloat16_t op2, svfloat16_t op3)
4652
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.fclamp.nxv4f32(<vscale x 4 x float> [[OP1:%.*]], <vscale x 4 x float> [[OP2:%.*]], <vscale x 4 x float> [[OP3:%.*]])
4753
// CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP0]]
4854
//
49-
svfloat32_t test_svclamp_f32(svfloat32_t op1, svfloat32_t op2, svfloat32_t op3) {
55+
svfloat32_t test_svclamp_f32(svfloat32_t op1, svfloat32_t op2, svfloat32_t op3) ATTR {
5056
return SVE_ACLE_FUNC(svclamp, _f32, , )(op1, op2, op3);
5157
}
5258

@@ -60,7 +66,7 @@ svfloat32_t test_svclamp_f32(svfloat32_t op1, svfloat32_t op2, svfloat32_t op3)
6066
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.fclamp.nxv2f64(<vscale x 2 x double> [[OP1:%.*]], <vscale x 2 x double> [[OP2:%.*]], <vscale x 2 x double> [[OP3:%.*]])
6167
// CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP0]]
6268
//
63-
svfloat64_t test_svclamp_f64(svfloat64_t op1, svfloat64_t op2, svfloat64_t op3) {
69+
svfloat64_t test_svclamp_f64(svfloat64_t op1, svfloat64_t op2, svfloat64_t op3) ATTR {
6470
return SVE_ACLE_FUNC(svclamp, _f64, , )(op1, op2, op3);
6571
}
6672

clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_ld1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
22
// REQUIRES: aarch64-registered-target
33
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -DTEST_SME2 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
4+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
5+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wno-unknown-attributes -Wall -emit-llvm -o - %s | FileCheck %s
46
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
57
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s
68
// RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -Wall -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK

clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_pext.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
22
// REQUIRES: aarch64-registered-target
3-
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -DTEST_SME2 -target-feature +sve -target-feature +sme2 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
3+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -target-feature +sme2 -S -DTEST_SME2 -O1 -Werror -emit-llvm -o - %s | FileCheck %s
44
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
55
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
6+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s
7+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -target-feature +sme2 -S -DTEST_SME2 -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK
8+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -o /dev/null %s
69

710
#include <arm_sve.h>
811

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
22
// REQUIRES: aarch64-registered-target
33
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4-
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
55
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
6-
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
6+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
77
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8-
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8+
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme2 -S -DTEST_SME2 -disable-O0-optnone -Werror -Wall -o /dev/null %s
99

1010
#include <arm_sve.h>
1111

12+
#ifndef TEST_SME2
13+
#define ATTR
14+
#else
15+
#define ATTR __arm_streaming
16+
#endif
17+
1218
// CHECK-LABEL: @test_svpfalse_c(
1319
// CHECK-NEXT: entry:
1420
// CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> zeroinitializer)
@@ -19,7 +25,7 @@
1925
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call target("aarch64.svcount") @llvm.aarch64.sve.convert.from.svbool.taarch64.svcountt(<vscale x 16 x i1> zeroinitializer)
2026
// CPP-CHECK-NEXT: ret target("aarch64.svcount") [[TMP0]]
2127
//
22-
svcount_t test_svpfalse_c(void) __arm_streaming_compatible
28+
svcount_t test_svpfalse_c(void) ATTR
2329
{
2430
return svpfalse_c();
2531
}

0 commit comments

Comments
 (0)