================
@@ -0,0 +1,69 @@
+// REQUIRES: aarch64-registered-target
+
+// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -o /dev/null 
-Rpass-analysis=sme %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -triple aarch64 -target-feature +sme -S -o /dev/null 
-Rpass-analysis=sme %s -mllvm -aarch64-new-sme-abi 2>&1 | FileCheck %s 
--check-prefix=CHECK-NEWLOWERING
+
+void private_za_callee_a();
+void private_za_callee_b();
+void private_za_callee_c();
+
+void test_za_merge_paths(int a) __arm_inout("za") {
+  if (a != 0)
+    private_za_callee_a();
+  else
+    private_za_callee_b();
+  // The new lowering won't report this call as the save is already needed due
+  // to the call to `private_za_callee_*()` calls on both paths to this BB.
+  private_za_callee_c();
+}
+
+void test_lazy_save_multiple_paths(int a) __arm_inout("za") {
+  if (a != 0)
+    private_za_callee_a();
+  else {
+    private_za_callee_b();
+    // The new lowering won't report this call as the save is already needed 
due
+    // to the call to `private_za_callee_b()`.
+    private_za_callee_c();
+  }
+}
+
+//      CHECK:  sme-remarks.c:14:5: remark: call from 'test_za_merge_paths' to 
'unknown callee' sets up a lazy save for ZA [-Rpass-analysis=sme]
+// CHECK-NEXT:     14 |     private_za_callee_b();
+// CHECK-NEXT:        |     ^
----------------
sdesmalen-arm wrote:

You can use Clang cc1's `-verify` option, so that you can write this inline, 
e.g.

```
12: ...
13: // expected-remark@+1 {{call from 'test_za_merge_paths' to 'unknown callee' 
sets up a lazy save for ZA}}
14: private_za_callee_b();
15: ...
```

https://github.com/llvm/llvm-project/pull/170277
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to