xref: /llvm-project/clang/test/CodeGen/AArch64/fmv-streaming.c (revision b93ffa8e4a11b89a8da02f409139f2ea862aabf0)
1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -emit-llvm -o - %s | FileCheck %s
2 
3 
4 // CHECK-LABEL: define {{[^@]+}}@n_callee._Msve
5 // CHECK-SAME: () #[[locally_streaming_sve:[0-9]+]] {
6 //
7 // CHECK-LABEL: define {{[^@]+}}@n_callee._Msimd
8 // CHECK-SAME: () #[[locally_streaming_simd:[0-9]+]] {
9 //
10 __arm_locally_streaming __attribute__((target_clones("sve", "simd"))) void n_callee(void) {}
11 // CHECK-LABEL: define {{[^@]+}}@n_callee._Msme2
12 // CHECK-SAME: () #[[sme2:[0-9]+]] {
13 //
14 __attribute__((target_version("sme2"))) void n_callee(void) {}
15 // CHECK-LABEL: define {{[^@]+}}@n_callee.default
16 // CHECK-SAME: () #[[default:[0-9]+]] {
17 //
18 __attribute__((target_version("default"))) void n_callee(void) {}
19 
20 
21 // CHECK-LABEL: define {{[^@]+}}@s_callee._Msve
22 // CHECK-SAME: () #[[sve_streaming:[0-9]+]] {
23 //
24 // CHECK-LABEL: define {{[^@]+}}@s_callee._Msimd
25 // CHECK-SAME: () #[[simd_streaming:[0-9]+]] {
26 //
27 __attribute__((target_clones("sve", "simd"))) void s_callee(void) __arm_streaming {}
28 // CHECK-LABEL: define {{[^@]+}}@s_callee._Msme2
29 // CHECK-SAME: () #[[locally_streaming_sme2_streaming:[0-9]+]] {
30 //
31 __arm_locally_streaming __attribute__((target_version("sme2"))) void s_callee(void) __arm_streaming {}
32 // CHECK-LABEL: define {{[^@]+}}@s_callee.default
33 // CHECK-SAME: () #[[default_streaming:[0-9]+]] {
34 //
35 __attribute__((target_version("default"))) void s_callee(void) __arm_streaming {}
36 
37 
38 // CHECK-LABEL: define {{[^@]+}}@sc_callee._Msve
39 // CHECK-SAME: () #[[sve_streaming_compatible:[0-9]+]] {
40 //
41 // CHECK-LABEL: define {{[^@]+}}@sc_callee._Msimd
42 // CHECK-SAME: () #[[simd_streaming_compatible:[0-9]+]] {
43 //
44 __attribute__((target_clones("sve", "simd"))) void sc_callee(void) __arm_streaming_compatible {}
45 // CHECK-LABEL: define {{[^@]+}}@sc_callee._Msme2
46 // CHECK-SAME: () #[[locally_streaming_sme2_streaming_compatible:[0-9]+]] {
47 //
48 __arm_locally_streaming __attribute__((target_version("sme2"))) void sc_callee(void) __arm_streaming_compatible {}
49 // CHECK-LABEL: define {{[^@]+}}@sc_callee.default
50 // CHECK-SAME: () #[[default_streaming_compatible:[0-9]+]] {
51 //
52 __attribute__((target_version("default"))) void sc_callee(void) __arm_streaming_compatible {}
53 
54 
55 // CHECK-LABEL: define {{[^@]+}}@n_caller
56 // CHECK-SAME: () #[[caller:[0-9]+]] {
57 // CHECK:    call void @n_callee()
58 // CHECK:    call void @s_callee() #[[callsite_streaming:[0-9]+]]
59 // CHECK:    call void @sc_callee() #[[callsite_streaming_compatible:[0-9]+]]
60 //
61 void n_caller(void) {
62   n_callee();
63   s_callee();
64   sc_callee();
65 }
66 
67 
68 // CHECK-LABEL: define {{[^@]+}}@s_caller
69 // CHECK-SAME: () #[[caller_streaming:[0-9]+]] {
70 // CHECK:    call void @n_callee()
71 // CHECK:    call void @s_callee() #[[callsite_streaming]]
72 // CHECK:    call void @sc_callee() #[[callsite_streaming_compatible]]
73 //
74 void s_caller(void) __arm_streaming {
75   n_callee();
76   s_callee();
77   sc_callee();
78 }
79 
80 
81 // CHECK-LABEL: define {{[^@]+}}@sc_caller
82 // CHECK-SAME: () #[[caller_streaming_compatible:[0-9]+]] {
83 // CHECK:    call void @n_callee()
84 // CHECK:    call void @s_callee() #[[callsite_streaming]]
85 // CHECK:    call void @sc_callee() #[[callsite_streaming_compatible]]
86 //
87 void sc_caller(void) __arm_streaming_compatible {
88   n_callee();
89   s_callee();
90   sc_callee();
91 }
92 
93 
94 // CHECK: attributes #[[locally_streaming_sve]] = {{.*}} "aarch64_pstate_sm_body"
95 // CHECK: attributes #[[locally_streaming_simd]] = {{.*}} "aarch64_pstate_sm_body"
96 // CHECK: attributes #[[sme2]] = {{.*}}
97 // CHECK: attributes #[[default]] = {{.*}}
98 // CHECK: attributes #[[sve_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
99 // CHECK: attributes #[[simd_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
100 // CHECK: attributes #[[locally_streaming_sme2_streaming]] = {{.*}} "aarch64_pstate_sm_body" "aarch64_pstate_sm_enabled"
101 // CHECK: attributes #[[default_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
102 // CHECK: attributes #[[sve_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
103 // CHECK: attributes #[[simd_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
104 // CHECK: attributes #[[locally_streaming_sme2_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_body" "aarch64_pstate_sm_compatible"
105 // CHECK: attributes #[[default_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
106 // CHECK: attributes #[[caller]] = {{.*}}
107 // CHECK: attributes #[[caller_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
108 // CHECK: attributes #[[caller_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
109 // CHECK: attributes #[[callsite_streaming]] = {{.*}} "aarch64_pstate_sm_enabled"
110 // CHECK: attributes #[[callsite_streaming_compatible]] = {{.*}} "aarch64_pstate_sm_compatible"
111