[llvm] [AArch64] Don't inline streaming Fn if caller has no SVE (PR #150595)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 05:32:00 PDT 2025


================
@@ -676,4 +676,26 @@ define void @streaming_caller_multiple_streaming_compatible_callees_inline() #0
   ret void
 }
 
+define void @nosve_streaming_function(ptr %ptr) "target-features"="+sme" "aarch64_pstate_sm_enabled" {
+; CHECK-LABEL: define void @nosve_streaming_function
+; CHECK-SAME: (ptr [[PTR:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT:    store <vscale x 4 x i32> zeroinitializer, ptr [[PTR]], align 16
+; CHECK-NEXT:    ret void
+;
+  store <vscale x 4 x i32> zeroinitializer, ptr %ptr
+  ret void
+}
+
+; Don't allow inlining a streaming function into a non-streaming function
+; if the non-streaming function has no SVE.
+define void @nosve_non_streaming_caller_streaming_callee_dont_inline(ptr %ptr) "target-features"="+sme"  {
+; CHECK-LABEL: define void @nosve_non_streaming_caller_streaming_callee_dont_inline
+; CHECK-SAME: (ptr [[PTR:%.*]]) #[[ATTR1]] {
+; CHECK-NEXT:    call void @nosve_streaming_function(ptr [[PTR]])
+; CHECK-NEXT:    ret void
+;
----------------
MacDue wrote:

Note the `ATTR2` and `ATTR1` checks are failing CI:

```
2025-07-25T09:28:26.9143177Z /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/Inline/AArch64/sme-pstatesm-attrs.ll:681:15: error: CHECK-SAME: expected string not found in input
2025-07-25T09:28:26.9144429Z ; CHECK-SAME: (ptr [[PTR:%.*]]) #[[ATTR2]] {
2025-07-25T09:28:26.9144838Z               ^
2025-07-25T09:28:26.9145147Z <stdin>:278:38: note: scanning from here
2025-07-25T09:28:26.9145614Z define void @nosve_streaming_function(ptr %ptr) #9 {
2025-07-25T09:28:26.9146067Z                                      ^
2025-07-25T09:28:26.9146497Z <stdin>:278:38: note: with "ATTR2" equal to "2"
2025-07-25T09:28:26.9146989Z define void @nosve_streaming_function(ptr %ptr) #9 {
2025-07-25T09:28:26.9147446Z                                      ^
2025-07-25T09:28:26.9148713Z /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/Transforms/Inline/AArch64/sme-pstatesm-attrs.ll:693:15: error: CHECK-SAME: expected string not found in input
2025-07-25T09:28:26.9149942Z ; CHECK-SAME: (ptr [[PTR:%.*]]) #[[ATTR1]] {
2025-07-25T09:28:26.9150351Z               ^
2025-07-25T09:28:26.9150656Z <stdin>:283:69: note: scanning from here
2025-07-25T09:28:26.9151289Z define void @nosve_non_streaming_caller_streaming_callee_dont_inline(ptr %ptr) #10 {
2025-07-25T09:28:26.9151948Z                                                                     ^
2025-07-25T09:28:26.9152585Z <stdin>:283:69: note: with "ATTR1" equal to "1"
2025-07-25T09:28:26.9153230Z define void @nosve_non_streaming_caller_streaming_callee_dont_inline(ptr %ptr) #10 {
```
I think this is due to the addition of `target-features`

https://github.com/llvm/llvm-project/pull/150595


More information about the llvm-commits mailing list