Debian Codegraph @

clang/test/CodeGen/AArch64/sme-remarks.c

raw
1 // REQUIRES: aarch64-registered-target
2
3 // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -mllvm -aarch64-new-sme-abi=false -Rpass-analysis=sme -verify=expected-sdag %s -S -o /dev/null
4 // RUN: %clang_cc1 -triple aarch64 -target-feature +sme -Rpass-analysis=sme -verify %s -S -o /dev/null %s
5
6 void private_za_callee_a();
7 void private_za_callee_b();
8 void private_za_callee_c();
9
10 void test_za_merge_paths(int a) __arm_inout("za") {
11 // expected-remark@+1 {{lazy save of ZA emitted in 'test_za_merge_paths'}}
12 if (a != 0)
13 // expected-sdag-remark@+2 {{call from 'test_za_merge_paths' to 'unknown callee' sets up a lazy save for ZA}}
14 // expected-remark@+1 {{call to 'private_za_callee_a' requires ZA save}}
15 private_za_callee_a();
16 else
17 // expected-sdag-remark@+2 {{call from 'test_za_merge_paths' to 'unknown callee' sets up a lazy save for ZA}}
18 // expected-remark@+1 {{call to 'private_za_callee_b' requires ZA save}}
19 private_za_callee_b();
20 // expected-sdag-remark@+3 {{call from 'test_za_merge_paths' to 'unknown callee' sets up a lazy save for ZA}}
21 /// The new lowering won't report this call as the save is already needed due
22 /// to the call to `private_za_callee_a/b()` calls on both paths to this call.
23 private_za_callee_c();
24 }
25
26 void test_lazy_save_multiple_paths(int a) __arm_inout("za") {
27 // expected-remark@+1 {{lazy save of ZA emitted in 'test_lazy_save_multiple_paths'}}
28 if (a != 0)
29 // expected-sdag-remark@+2 {{call from 'test_lazy_save_multiple_paths' to 'unknown callee' sets up a lazy save for ZA}}
30 // expected-remark@+1 {{call to 'private_za_callee_a' requires ZA save}}
31 private_za_callee_a();
32 else {
33 // expected-sdag-remark@+2 {{call from 'test_lazy_save_multiple_paths' to 'unknown callee' sets up a lazy save for ZA}}
34 // expected-remark@+1 {{call to 'private_za_callee_b' requires ZA save}}
35 private_za_callee_b();
36 // expected-sdag-remark@+3 {{call from 'test_lazy_save_multiple_paths' to 'unknown callee' sets up a lazy save for ZA}}
37 /// The new lowering won't report this call as the save is already needed
38 /// due to the call to `private_za_callee_b()`.
39 private_za_callee_c();
40 }
41 }