xref: /llvm-project/clang/test/CodeGen/AArch64/fmv-streaming.c (revision b93ffa8e4a11b89a8da02f409139f2ea862aabf0)
1207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -emit-llvm -o - %s | FileCheck %s
2207e5cccSFangrui Song 
3207e5cccSFangrui Song 
4207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@n_callee._Msve
5461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[locally_streaming_sve:[0-9]+]] {
6207e5cccSFangrui Song //
7207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@n_callee._Msimd
8461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[locally_streaming_simd:[0-9]+]] {
9207e5cccSFangrui Song //
10207e5cccSFangrui Song __arm_locally_streaming __attribute__((target_clones("sve", "simd"))) void n_callee(void) {}
11207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@n_callee._Msme2
12461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[sme2:[0-9]+]] {
13207e5cccSFangrui Song //
14207e5cccSFangrui Song __attribute__((target_version("sme2"))) void n_callee(void) {}
15207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@n_callee.default
16461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[default:[0-9]+]] {
17207e5cccSFangrui Song //
18207e5cccSFangrui Song __attribute__((target_version("default"))) void n_callee(void) {}
19207e5cccSFangrui Song 
20207e5cccSFangrui Song 
21207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@s_callee._Msve
22461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[sve_streaming:[0-9]+]] {
23207e5cccSFangrui Song //
24207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@s_callee._Msimd
25461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[simd_streaming:[0-9]+]] {
26207e5cccSFangrui Song //
27207e5cccSFangrui Song __attribute__((target_clones("sve", "simd"))) void s_callee(void) __arm_streaming {}
28207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@s_callee._Msme2
29461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[locally_streaming_sme2_streaming:[0-9]+]] {
30207e5cccSFangrui Song //
31207e5cccSFangrui Song __arm_locally_streaming __attribute__((target_version("sme2"))) void s_callee(void) __arm_streaming {}
32207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@s_callee.default
33461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[default_streaming:[0-9]+]] {
34207e5cccSFangrui Song //
35207e5cccSFangrui Song __attribute__((target_version("default"))) void s_callee(void) __arm_streaming {}
36207e5cccSFangrui Song 
37207e5cccSFangrui Song 
38207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@sc_callee._Msve
39461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[sve_streaming_compatible:[0-9]+]] {
40207e5cccSFangrui Song //
41207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@sc_callee._Msimd
42461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[simd_streaming_compatible:[0-9]+]] {
43207e5cccSFangrui Song //
44207e5cccSFangrui Song __attribute__((target_clones("sve", "simd"))) void sc_callee(void) __arm_streaming_compatible {}
45207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@sc_callee._Msme2
46461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[locally_streaming_sme2_streaming_compatible:[0-9]+]] {
47207e5cccSFangrui Song //
48207e5cccSFangrui Song __arm_locally_streaming __attribute__((target_version("sme2"))) void sc_callee(void) __arm_streaming_compatible {}
49207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@sc_callee.default
50461a0d6cSAlexandros Lamprineas // CHECK-SAME: () #[[default_streaming_compatible:[0-9]+]] {
51207e5cccSFangrui Song //
52207e5cccSFangrui Song __attribute__((target_version("default"))) void sc_callee(void) __arm_streaming_compatible {}
53207e5cccSFangrui Song 
54207e5cccSFangrui Song 
55207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@n_caller
56*b93ffa8eSAlexandros Lamprineas // CHECK-SAME: () #[[caller:[0-9]+]] {
57207e5cccSFangrui Song // CHECK:    call void @n_callee()
58*b93ffa8eSAlexandros Lamprineas // CHECK:    call void @s_callee() #[[callsite_streaming:[0-9]+]]
59*b93ffa8eSAlexandros Lamprineas // CHECK:    call void @sc_callee() #[[callsite_streaming_compatible:[0-9]+]]
60207e5cccSFangrui Song //
61207e5cccSFangrui Song void n_caller(void) {
62207e5cccSFangrui Song   n_callee();
63207e5cccSFangrui Song   s_callee();
64207e5cccSFangrui Song   sc_callee();
65207e5cccSFangrui Song }
66207e5cccSFangrui Song 
67207e5cccSFangrui Song 
68207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@s_caller
69*b93ffa8eSAlexandros Lamprineas // CHECK-SAME: () #[[caller_streaming:[0-9]+]] {
70207e5cccSFangrui Song // CHECK:    call void @n_callee()
71*b93ffa8eSAlexandros Lamprineas // CHECK:    call void @s_callee() #[[callsite_streaming]]
72*b93ffa8eSAlexandros Lamprineas // CHECK:    call void @sc_callee() #[[callsite_streaming_compatible]]
73207e5cccSFangrui Song //
74207e5cccSFangrui Song void s_caller(void) __arm_streaming {
75207e5cccSFangrui Song   n_callee();
76207e5cccSFangrui Song   s_callee();
77207e5cccSFangrui Song   sc_callee();
78207e5cccSFangrui Song }
79207e5cccSFangrui Song 
80207e5cccSFangrui Song 
81207e5cccSFangrui Song // CHECK-LABEL: define {{[^@]+}}@sc_caller
82*b93ffa8eSAlexandros Lamprineas // CHECK-SAME: () #[[caller_streaming_compatible:[0-9]+]] {
83207e5cccSFangrui Song // CHECK:    call void @n_callee()
84*b93ffa8eSAlexandros Lamprineas // CHECK:    call void @s_callee() #[[callsite_streaming]]
85*b93ffa8eSAlexandros Lamprineas // CHECK:    call void @sc_callee() #[[callsite_streaming_compatible]]
86207e5cccSFangrui Song //
87207e5cccSFangrui Song void sc_caller(void) __arm_streaming_compatible {
88207e5cccSFangrui Song   n_callee();
89207e5cccSFangrui Song   s_callee();
90207e5cccSFangrui Song   sc_callee();
91207e5cccSFangrui Song }
92207e5cccSFangrui Song 
93207e5cccSFangrui Song 
94461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[locally_streaming_sve]] = {{.*}} "aarch64_pstate_sm_body"
95461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[locally_streaming_simd]] = {{.*}} "aarch64_pstate_sm_body"
96461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[sme2]] = {{.*}}
97461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[default]] = {{.*}}
98461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[sve_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
99461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[simd_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
100461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[locally_streaming_sme2_streaming]] = {{.*}} "aarch64_pstate_sm_body" "aarch64_pstate_sm_enabled"
101461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[default_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
102461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[sve_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
103461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[simd_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
104461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[locally_streaming_sme2_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_body" "aarch64_pstate_sm_compatible"
105461a0d6cSAlexandros Lamprineas // CHECK: attributes #[[default_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
106*b93ffa8eSAlexandros Lamprineas // CHECK: attributes #[[caller]] = {{.*}}
107*b93ffa8eSAlexandros Lamprineas // CHECK: attributes #[[caller_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
108*b93ffa8eSAlexandros Lamprineas // CHECK: attributes #[[caller_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
109*b93ffa8eSAlexandros Lamprineas // CHECK: attributes #[[callsite_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
110*b93ffa8eSAlexandros Lamprineas // CHECK: attributes #[[callsite_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
111