Skip to content

Commit 4cfce25

Browse files
committed
[AArch64] Dont inline streaming fn into non-streaming caller
Without this change, the following test would fail to compile with `-march=armv8-a+sme`: void func1(const svuint32_t *in, svuint32_t *out) { [&]() __arm_streaming { *out = *in; }(); } But in general, it's probably better never to inline streaming functions into non-streaming functions, because they will have been marked as 'streaming' for a reason by the user.
1 parent 3251573 commit 4cfce25

File tree

3 files changed

+52
-47
lines changed

3 files changed

+52
-47
lines changed

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ bool AArch64TTIImpl::areInlineCompatible(const Function *Caller,
270270
const Function *Callee) const {
271271
SMECallAttrs CallAttrs(*Caller, *Callee);
272272

273+
// Never inline a function explicitly marked as being streaming,
274+
// into a non-streaming function. Assume it was marked as streaming
275+
// for a reason.
276+
if (CallAttrs.caller().hasNonStreamingInterfaceAndBody() &&
277+
CallAttrs.callee().hasStreamingInterfaceOrBody())
278+
return false;
279+
273280
// When inlining, we should consider the body of the function, not the
274281
// interface.
275282
if (CallAttrs.callee().hasStreamingBody()) {

llvm/test/Transforms/Inline/AArch64/sme-pstatesm-attrs-low-threshold.ll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ define void @streaming_callee() #0 "aarch64_pstate_sm_enabled" {
2525
define void @non_streaming_caller_inline() #0 {
2626
; CHECK-LABEL: define void @non_streaming_caller_inline
2727
; CHECK-SAME: () #[[ATTR2:[0-9]+]] {
28-
; CHECK-NEXT: call void @streaming_compatible_f()
29-
; CHECK-NEXT: call void @streaming_compatible_f()
28+
; CHECK-NEXT: call void @streaming_callee()
3029
; CHECK-NEXT: ret void
3130
;
3231
call void @streaming_callee()

llvm/test/Transforms/Inline/AArch64/sme-pstatesm-attrs.ll

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ entry:
8686
; [ ] N -> SC + B
8787
define i32 @normal_caller_normal_callee_inline() #0 {
8888
; CHECK-LABEL: define i32 @normal_caller_normal_callee_inline
89-
; CHECK-SAME: () #[[ATTR6:[0-9]+]] {
89+
; CHECK-SAME: () #[[ATTR1]] {
9090
; CHECK-NEXT: entry:
9191
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
9292
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -103,7 +103,7 @@ entry:
103103
; [ ] N -> SC + B
104104
define i32 @normal_caller_streaming_callee_dont_inline() #0 {
105105
; CHECK-LABEL: define i32 @normal_caller_streaming_callee_dont_inline
106-
; CHECK-SAME: () #[[ATTR6]] {
106+
; CHECK-SAME: () #[[ATTR1]] {
107107
; CHECK-NEXT: entry:
108108
; CHECK-NEXT: [[RES:%.*]] = call i32 @streaming_callee()
109109
; CHECK-NEXT: ret i32 [[RES]]
@@ -120,7 +120,7 @@ entry:
120120
; [ ] N -> SC + B
121121
define i32 @normal_caller_streaming_compatible_callee_inline() #0 {
122122
; CHECK-LABEL: define i32 @normal_caller_streaming_compatible_callee_inline
123-
; CHECK-SAME: () #[[ATTR6]] {
123+
; CHECK-SAME: () #[[ATTR1]] {
124124
; CHECK-NEXT: entry:
125125
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
126126
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -137,7 +137,7 @@ entry:
137137
; [ ] N -> SC + B
138138
define i32 @normal_caller_locally_streaming_callee_dont_inline() #0 {
139139
; CHECK-LABEL: define i32 @normal_caller_locally_streaming_callee_dont_inline
140-
; CHECK-SAME: () #[[ATTR6]] {
140+
; CHECK-SAME: () #[[ATTR1]] {
141141
; CHECK-NEXT: entry:
142142
; CHECK-NEXT: [[RES:%.*]] = call i32 @locally_streaming_callee()
143143
; CHECK-NEXT: ret i32 [[RES]]
@@ -154,7 +154,7 @@ entry:
154154
; [x] N -> SC + B
155155
define i32 @normal_caller_streaming_compatible_locally_streaming_callee_dont_inline() #0 {
156156
; CHECK-LABEL: define i32 @normal_caller_streaming_compatible_locally_streaming_callee_dont_inline
157-
; CHECK-SAME: () #[[ATTR6]] {
157+
; CHECK-SAME: () #[[ATTR1]] {
158158
; CHECK-NEXT: entry:
159159
; CHECK-NEXT: [[RES:%.*]] = call i32 @streaming_compatible_locally_streaming_callee()
160160
; CHECK-NEXT: ret i32 [[RES]]
@@ -171,7 +171,7 @@ entry:
171171
; [ ] S -> SC + B
172172
define i32 @streaming_caller_normal_callee_dont_inline() #0 "aarch64_pstate_sm_enabled" {
173173
; CHECK-LABEL: define i32 @streaming_caller_normal_callee_dont_inline
174-
; CHECK-SAME: () #[[ATTR7:[0-9]+]] {
174+
; CHECK-SAME: () #[[ATTR2]] {
175175
; CHECK-NEXT: entry:
176176
; CHECK-NEXT: [[RES:%.*]] = call i32 @normal_callee()
177177
; CHECK-NEXT: ret i32 [[RES]]
@@ -188,7 +188,7 @@ entry:
188188
; [ ] S -> SC + B
189189
define i32 @streaming_caller_streaming_callee_inline() #0 "aarch64_pstate_sm_enabled" {
190190
; CHECK-LABEL: define i32 @streaming_caller_streaming_callee_inline
191-
; CHECK-SAME: () #[[ATTR7]] {
191+
; CHECK-SAME: () #[[ATTR2]] {
192192
; CHECK-NEXT: entry:
193193
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
194194
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -205,7 +205,7 @@ entry:
205205
; [ ] S -> SC + B
206206
define i32 @streaming_caller_streaming_compatible_callee_inline() #0 "aarch64_pstate_sm_enabled" {
207207
; CHECK-LABEL: define i32 @streaming_caller_streaming_compatible_callee_inline
208-
; CHECK-SAME: () #[[ATTR7]] {
208+
; CHECK-SAME: () #[[ATTR2]] {
209209
; CHECK-NEXT: entry:
210210
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
211211
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -222,7 +222,7 @@ entry:
222222
; [ ] S -> SC + B
223223
define i32 @streaming_caller_locally_streaming_callee_inline() #0 "aarch64_pstate_sm_enabled" {
224224
; CHECK-LABEL: define i32 @streaming_caller_locally_streaming_callee_inline
225-
; CHECK-SAME: () #[[ATTR7]] {
225+
; CHECK-SAME: () #[[ATTR2]] {
226226
; CHECK-NEXT: entry:
227227
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
228228
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -239,7 +239,7 @@ entry:
239239
; [x] S -> SC + B
240240
define i32 @streaming_caller_streaming_compatible_locally_streaming_callee_inline() #0 "aarch64_pstate_sm_enabled" {
241241
; CHECK-LABEL: define i32 @streaming_caller_streaming_compatible_locally_streaming_callee_inline
242-
; CHECK-SAME: () #[[ATTR7]] {
242+
; CHECK-SAME: () #[[ATTR2]] {
243243
; CHECK-NEXT: entry:
244244
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
245245
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -256,7 +256,7 @@ entry:
256256
; [ ] N + B -> SC + B
257257
define i32 @locally_streaming_caller_normal_callee_dont_inline() #0 "aarch64_pstate_sm_body" {
258258
; CHECK-LABEL: define i32 @locally_streaming_caller_normal_callee_dont_inline
259-
; CHECK-SAME: () #[[ATTR8:[0-9]+]] {
259+
; CHECK-SAME: () #[[ATTR3]] {
260260
; CHECK-NEXT: entry:
261261
; CHECK-NEXT: [[RES:%.*]] = call i32 @normal_callee()
262262
; CHECK-NEXT: ret i32 [[RES]]
@@ -273,7 +273,7 @@ entry:
273273
; [ ] N + B -> SC + B
274274
define i32 @locally_streaming_caller_streaming_callee_inline() #0 "aarch64_pstate_sm_body" {
275275
; CHECK-LABEL: define i32 @locally_streaming_caller_streaming_callee_inline
276-
; CHECK-SAME: () #[[ATTR8]] {
276+
; CHECK-SAME: () #[[ATTR3]] {
277277
; CHECK-NEXT: entry:
278278
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
279279
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -290,7 +290,7 @@ entry:
290290
; [ ] N + B -> SC + B
291291
define i32 @locally_streaming_caller_streaming_compatible_callee_inline() #0 "aarch64_pstate_sm_body" {
292292
; CHECK-LABEL: define i32 @locally_streaming_caller_streaming_compatible_callee_inline
293-
; CHECK-SAME: () #[[ATTR8]] {
293+
; CHECK-SAME: () #[[ATTR3]] {
294294
; CHECK-NEXT: entry:
295295
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
296296
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -307,7 +307,7 @@ entry:
307307
; [ ] N + B -> SC + B
308308
define i32 @locally_streaming_caller_locally_streaming_callee_inline() #0 "aarch64_pstate_sm_body" {
309309
; CHECK-LABEL: define i32 @locally_streaming_caller_locally_streaming_callee_inline
310-
; CHECK-SAME: () #[[ATTR8]] {
310+
; CHECK-SAME: () #[[ATTR3]] {
311311
; CHECK-NEXT: entry:
312312
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
313313
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -324,7 +324,7 @@ entry:
324324
; [x] N + B -> SC + B
325325
define i32 @locally_streaming_caller_streaming_compatible_locally_streaming_callee_inline() #0 "aarch64_pstate_sm_body" {
326326
; CHECK-LABEL: define i32 @locally_streaming_caller_streaming_compatible_locally_streaming_callee_inline
327-
; CHECK-SAME: () #[[ATTR8]] {
327+
; CHECK-SAME: () #[[ATTR3]] {
328328
; CHECK-NEXT: entry:
329329
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
330330
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -341,7 +341,7 @@ entry:
341341
; [ ] SC -> SC + B
342342
define i32 @streaming_compatible_caller_normal_callee_dont_inline() #0 "aarch64_pstate_sm_compatible" {
343343
; CHECK-LABEL: define i32 @streaming_compatible_caller_normal_callee_dont_inline
344-
; CHECK-SAME: () #[[ATTR9:[0-9]+]] {
344+
; CHECK-SAME: () #[[ATTR4]] {
345345
; CHECK-NEXT: entry:
346346
; CHECK-NEXT: [[RES:%.*]] = call i32 @normal_callee()
347347
; CHECK-NEXT: ret i32 [[RES]]
@@ -358,7 +358,7 @@ entry:
358358
; [ ] SC -> SC + B
359359
define i32 @streaming_compatible_caller_streaming_callee_dont_inline() #0 "aarch64_pstate_sm_compatible" {
360360
; CHECK-LABEL: define i32 @streaming_compatible_caller_streaming_callee_dont_inline
361-
; CHECK-SAME: () #[[ATTR9]] {
361+
; CHECK-SAME: () #[[ATTR4]] {
362362
; CHECK-NEXT: entry:
363363
; CHECK-NEXT: [[RES:%.*]] = call i32 @streaming_callee()
364364
; CHECK-NEXT: ret i32 [[RES]]
@@ -375,7 +375,7 @@ entry:
375375
; [ ] SC -> SC + B
376376
define i32 @streaming_compatible_caller_streaming_compatible_callee_inline() #0 "aarch64_pstate_sm_compatible" {
377377
; CHECK-LABEL: define i32 @streaming_compatible_caller_streaming_compatible_callee_inline
378-
; CHECK-SAME: () #[[ATTR9]] {
378+
; CHECK-SAME: () #[[ATTR4]] {
379379
; CHECK-NEXT: entry:
380380
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
381381
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -392,7 +392,7 @@ entry:
392392
; [ ] SC -> SC + B
393393
define i32 @streaming_compatible_caller_locally_streaming_callee_dont_inline() #0 "aarch64_pstate_sm_compatible" {
394394
; CHECK-LABEL: define i32 @streaming_compatible_caller_locally_streaming_callee_dont_inline
395-
; CHECK-SAME: () #[[ATTR9]] {
395+
; CHECK-SAME: () #[[ATTR4]] {
396396
; CHECK-NEXT: entry:
397397
; CHECK-NEXT: [[RES:%.*]] = call i32 @locally_streaming_callee()
398398
; CHECK-NEXT: ret i32 [[RES]]
@@ -409,7 +409,7 @@ entry:
409409
; [x] SC -> SC + B
410410
define i32 @streaming_compatible_caller_streaming_compatible_locally_streaming_callee_dont_inline() #0 "aarch64_pstate_sm_compatible" {
411411
; CHECK-LABEL: define i32 @streaming_compatible_caller_streaming_compatible_locally_streaming_callee_dont_inline
412-
; CHECK-SAME: () #[[ATTR9]] {
412+
; CHECK-SAME: () #[[ATTR4]] {
413413
; CHECK-NEXT: entry:
414414
; CHECK-NEXT: [[RES:%.*]] = call i32 @streaming_compatible_locally_streaming_callee()
415415
; CHECK-NEXT: ret i32 [[RES]]
@@ -425,7 +425,7 @@ entry:
425425
; [ ] SC + B -> SC + B
426426
define i32 @streaming_compatible_locally_streaming_caller_normal_callee_dont_inline() #0 "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
427427
; CHECK-LABEL: define i32 @streaming_compatible_locally_streaming_caller_normal_callee_dont_inline
428-
; CHECK-SAME: () #[[ATTR10:[0-9]+]] {
428+
; CHECK-SAME: () #[[ATTR5]] {
429429
; CHECK-NEXT: entry:
430430
; CHECK-NEXT: [[RES:%.*]] = call i32 @normal_callee()
431431
; CHECK-NEXT: ret i32 [[RES]]
@@ -442,7 +442,7 @@ entry:
442442
; [ ] SC + B -> SC + B
443443
define i32 @streaming_compatible_locally_streaming_caller_streaming_callee_inline() #0 "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
444444
; CHECK-LABEL: define i32 @streaming_compatible_locally_streaming_caller_streaming_callee_inline
445-
; CHECK-SAME: () #[[ATTR10]] {
445+
; CHECK-SAME: () #[[ATTR5]] {
446446
; CHECK-NEXT: entry:
447447
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
448448
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -459,7 +459,7 @@ entry:
459459
; [ ] SC + B -> SC + B
460460
define i32 @streaming_compatible_locally_streaming_caller_streaming_compatible_callee_inline() #0 "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
461461
; CHECK-LABEL: define i32 @streaming_compatible_locally_streaming_caller_streaming_compatible_callee_inline
462-
; CHECK-SAME: () #[[ATTR10]] {
462+
; CHECK-SAME: () #[[ATTR5]] {
463463
; CHECK-NEXT: entry:
464464
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
465465
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -476,7 +476,7 @@ entry:
476476
; [ ] SC + B -> SC + B
477477
define i32 @streaming_compatible_locally_streaming_caller_locally_streaming_callee_inline() #0 "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
478478
; CHECK-LABEL: define i32 @streaming_compatible_locally_streaming_caller_locally_streaming_callee_inline
479-
; CHECK-SAME: () #[[ATTR10]] {
479+
; CHECK-SAME: () #[[ATTR5]] {
480480
; CHECK-NEXT: entry:
481481
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
482482
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -493,7 +493,7 @@ entry:
493493
; [x] SC + B -> SC + B
494494
define i32 @streaming_compatible_locally_streaming_caller_and_callee_inline() #0 "aarch64_pstate_sm_compatible" "aarch64_pstate_sm_body" {
495495
; CHECK-LABEL: define i32 @streaming_compatible_locally_streaming_caller_and_callee_inline
496-
; CHECK-SAME: () #[[ATTR10]] {
496+
; CHECK-SAME: () #[[ATTR5]] {
497497
; CHECK-NEXT: entry:
498498
; CHECK-NEXT: [[RES_I:%.*]] = call i32 @llvm.vscale.i32()
499499
; CHECK-NEXT: ret i32 [[RES_I]]
@@ -505,7 +505,7 @@ entry:
505505

506506
define void @normal_callee_with_inlineasm() #0 {
507507
; CHECK-LABEL: define void @normal_callee_with_inlineasm
508-
; CHECK-SAME: () #[[ATTR6]] {
508+
; CHECK-SAME: () #[[ATTR1]] {
509509
; CHECK-NEXT: entry:
510510
; CHECK-NEXT: call void asm sideeffect "
511511
; CHECK-NEXT: ret void
@@ -517,7 +517,7 @@ entry:
517517

518518
define void @streaming_caller_normal_callee_with_inlineasm_dont_inline() #0 "aarch64_pstate_sm_enabled" {
519519
; CHECK-LABEL: define void @streaming_caller_normal_callee_with_inlineasm_dont_inline
520-
; CHECK-SAME: () #[[ATTR7]] {
520+
; CHECK-SAME: () #[[ATTR2]] {
521521
; CHECK-NEXT: entry:
522522
; CHECK-NEXT: call void @normal_callee_with_inlineasm()
523523
; CHECK-NEXT: ret void
@@ -529,7 +529,7 @@ entry:
529529

530530
define i64 @normal_callee_with_intrinsic_call() #0 {
531531
; CHECK-LABEL: define i64 @normal_callee_with_intrinsic_call
532-
; CHECK-SAME: () #[[ATTR6]] {
532+
; CHECK-SAME: () #[[ATTR1]] {
533533
; CHECK-NEXT: entry:
534534
; CHECK-NEXT: [[RES:%.*]] = call i64 @llvm.aarch64.sve.cntb(i32 4)
535535
; CHECK-NEXT: ret i64 [[RES]]
@@ -541,7 +541,7 @@ entry:
541541

542542
define i64 @streaming_caller_normal_callee_with_intrinsic_call_dont_inline() #0 "aarch64_pstate_sm_enabled" {
543543
; CHECK-LABEL: define i64 @streaming_caller_normal_callee_with_intrinsic_call_dont_inline
544-
; CHECK-SAME: () #[[ATTR7]] {
544+
; CHECK-SAME: () #[[ATTR2]] {
545545
; CHECK-NEXT: entry:
546546
; CHECK-NEXT: [[RES:%.*]] = call i64 @normal_callee_with_intrinsic_call()
547547
; CHECK-NEXT: ret i64 [[RES]]
@@ -555,7 +555,7 @@ declare i64 @llvm.aarch64.sve.cntb(i32)
555555

556556
define i64 @normal_callee_call_sme_state() #0 {
557557
; CHECK-LABEL: define i64 @normal_callee_call_sme_state
558-
; CHECK-SAME: () #[[ATTR6]] {
558+
; CHECK-SAME: () #[[ATTR1]] {
559559
; CHECK-NEXT: entry:
560560
; CHECK-NEXT: [[RES:%.*]] = call { i64, i64 } @__arm_sme_state()
561561
; CHECK-NEXT: [[RES_0:%.*]] = extractvalue { i64, i64 } [[RES]], 0
@@ -571,7 +571,7 @@ declare {i64, i64} @__arm_sme_state()
571571

572572
define i64 @streaming_caller_normal_callee_call_sme_state_dont_inline() #0 "aarch64_pstate_sm_enabled" {
573573
; CHECK-LABEL: define i64 @streaming_caller_normal_callee_call_sme_state_dont_inline
574-
; CHECK-SAME: () #[[ATTR7]] {
574+
; CHECK-SAME: () #[[ATTR2]] {
575575
; CHECK-NEXT: entry:
576576
; CHECK-NEXT: [[RES:%.*]] = call i64 @normal_callee_call_sme_state()
577577
; CHECK-NEXT: ret i64 [[RES]]
@@ -587,7 +587,7 @@ declare void @streaming_body() "aarch64_pstate_sm_enabled"
587587

588588
define void @streaming_caller_single_streaming_callee() #0 "aarch64_pstate_sm_enabled" {
589589
; CHECK-LABEL: define void @streaming_caller_single_streaming_callee
590-
; CHECK-SAME: () #[[ATTR7]] {
590+
; CHECK-SAME: () #[[ATTR2]] {
591591
; CHECK-NEXT: call void @streaming_body()
592592
; CHECK-NEXT: ret void
593593
;
@@ -597,7 +597,7 @@ define void @streaming_caller_single_streaming_callee() #0 "aarch64_pstate_sm_e
597597

598598
define void @streaming_caller_multiple_streaming_callees() #0 "aarch64_pstate_sm_enabled" {
599599
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_callees
600-
; CHECK-SAME: () #[[ATTR7]] {
600+
; CHECK-SAME: () #[[ATTR2]] {
601601
; CHECK-NEXT: call void @streaming_body()
602602
; CHECK-NEXT: call void @streaming_body()
603603
; CHECK-NEXT: ret void
@@ -610,8 +610,8 @@ define void @streaming_caller_multiple_streaming_callees() #0 "aarch64_pstate_s
610610
; Allow inlining, as inline it would not increase the number of streaming-mode changes.
611611
define void @streaming_caller_single_streaming_callee_inline() #0 {
612612
; CHECK-LABEL: define void @streaming_caller_single_streaming_callee_inline
613-
; CHECK-SAME: () #[[ATTR6]] {
614-
; CHECK-NEXT: call void @streaming_body()
613+
; CHECK-SAME: () #[[ATTR1]] {
614+
; CHECK-NEXT: call void @streaming_caller_single_streaming_callee()
615615
; CHECK-NEXT: ret void
616616
;
617617
call void @streaming_caller_single_streaming_callee()
@@ -621,7 +621,7 @@ define void @streaming_caller_single_streaming_callee_inline() #0 {
621621
; Prevent inlining, as inline it would lead to multiple streaming-mode changes.
622622
define void @streaming_caller_multiple_streaming_callees_dont_inline() #0 {
623623
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_callees_dont_inline
624-
; CHECK-SAME: () #[[ATTR6]] {
624+
; CHECK-SAME: () #[[ATTR1]] {
625625
; CHECK-NEXT: call void @streaming_caller_multiple_streaming_callees()
626626
; CHECK-NEXT: ret void
627627
;
@@ -633,7 +633,7 @@ declare void @streaming_compatible_body() "aarch64_pstate_sm_compatible"
633633

634634
define void @streaming_caller_single_streaming_compatible_callee() #0 "aarch64_pstate_sm_enabled" {
635635
; CHECK-LABEL: define void @streaming_caller_single_streaming_compatible_callee
636-
; CHECK-SAME: () #[[ATTR7]] {
636+
; CHECK-SAME: () #[[ATTR2]] {
637637
; CHECK-NEXT: call void @streaming_compatible_body()
638638
; CHECK-NEXT: ret void
639639
;
@@ -643,7 +643,7 @@ define void @streaming_caller_single_streaming_compatible_callee() #0 "aarch64_
643643

644644
define void @streaming_caller_multiple_streaming_compatible_callees() #0 "aarch64_pstate_sm_enabled" {
645645
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_compatible_callees
646-
; CHECK-SAME: () #[[ATTR7]] {
646+
; CHECK-SAME: () #[[ATTR2]] {
647647
; CHECK-NEXT: call void @streaming_compatible_body()
648648
; CHECK-NEXT: call void @streaming_compatible_body()
649649
; CHECK-NEXT: ret void
@@ -656,8 +656,8 @@ define void @streaming_caller_multiple_streaming_compatible_callees() #0 "aarch
656656
; Allow inlining, as inline would remove a streaming-mode change.
657657
define void @streaming_caller_single_streaming_compatible_callee_inline() #0 {
658658
; CHECK-LABEL: define void @streaming_caller_single_streaming_compatible_callee_inline
659-
; CHECK-SAME: () #[[ATTR6]] {
660-
; CHECK-NEXT: call void @streaming_compatible_body()
659+
; CHECK-SAME: () #[[ATTR1]] {
660+
; CHECK-NEXT: call void @streaming_caller_single_streaming_compatible_callee()
661661
; CHECK-NEXT: ret void
662662
;
663663
call void @streaming_caller_single_streaming_compatible_callee()
@@ -667,9 +667,8 @@ define void @streaming_caller_single_streaming_compatible_callee_inline() #0 {
667667
; Allow inlining, as inline would remove several stremaing-mode changes.
668668
define void @streaming_caller_multiple_streaming_compatible_callees_inline() #0 {
669669
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_compatible_callees_inline
670-
; CHECK-SAME: () #[[ATTR6]] {
671-
; CHECK-NEXT: call void @streaming_compatible_body()
672-
; CHECK-NEXT: call void @streaming_compatible_body()
670+
; CHECK-SAME: () #[[ATTR1]] {
671+
; CHECK-NEXT: call void @streaming_caller_multiple_streaming_compatible_callees()
673672
; CHECK-NEXT: ret void
674673
;
675674
call void @streaming_caller_multiple_streaming_compatible_callees()
@@ -690,7 +689,7 @@ define void @simple_streaming_function(ptr %ptr) #0 "aarch64_pstate_sm_enabled"
690689
define void @non_streaming_caller_streaming_callee_dont_inline(ptr %ptr) #0 {
691690
; CHECK-LABEL: define void @non_streaming_caller_streaming_callee_dont_inline
692691
; CHECK-SAME: (ptr [[PTR:%.*]]) #[[ATTR1]] {
693-
; CHECK-NEXT: store <vscale x 4 x i32> zeroinitializer, ptr [[PTR]], align 16
692+
; CHECK-NEXT: call void @simple_streaming_function(ptr [[PTR]])
694693
; CHECK-NEXT: ret void
695694
;
696695
call void @simple_streaming_function(ptr %ptr)
@@ -711,7 +710,7 @@ define void @simple_locally_streaming_function(ptr %ptr) #0 "aarch64_pstate_sm_b
711710
define void @non_streaming_caller_locally_streaming_callee_dont_inline(ptr %ptr) #0 {
712711
; CHECK-LABEL: define void @non_streaming_caller_locally_streaming_callee_dont_inline
713712
; CHECK-SAME: (ptr [[PTR:%.*]]) #[[ATTR1]] {
714-
; CHECK-NEXT: store <vscale x 4 x i32> zeroinitializer, ptr [[PTR]], align 16
713+
; CHECK-NEXT: call void @simple_locally_streaming_function(ptr [[PTR]])
715714
; CHECK-NEXT: ret void
716715
;
717716
call void @simple_locally_streaming_function(ptr %ptr)

0 commit comments

Comments
 (0)