Skip to content

Commit c7b4c03

Browse files
committed
Fix tests
Because the behaviour now changed, I've had to modify some of the other tests to test inlining with streaming mode changes the other way around (streaming <- non-streaming instead of non-streaming <- streaming)
1 parent 4cfce25 commit c7b4c03

File tree

2 files changed

+52
-50
lines changed

2 files changed

+52
-50
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ declare void @streaming_compatible_f() #0 "aarch64_pstate_sm_compatible"
99

1010
; Function @streaming_callee doesn't contain any operations that may use ZA
1111
; state and therefore can be legally inlined into a normal function.
12-
define void @streaming_callee() #0 "aarch64_pstate_sm_enabled" {
13-
; CHECK-LABEL: define void @streaming_callee
12+
define void @non_streaming_callee() #0 {
13+
; CHECK-LABEL: define void @non_streaming_callee
1414
; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
1515
; CHECK-NEXT: call void @streaming_compatible_f()
1616
; CHECK-NEXT: call void @streaming_compatible_f()
@@ -22,24 +22,25 @@ define void @streaming_callee() #0 "aarch64_pstate_sm_enabled" {
2222
}
2323

2424
; Inline call to @streaming_callee to remove a streaming mode change.
25-
define void @non_streaming_caller_inline() #0 {
26-
; CHECK-LABEL: define void @non_streaming_caller_inline
25+
define void @streaming_caller_inline() #0 "aarch64_pstate_sm_enabled" {
26+
; CHECK-LABEL: define void @streaming_caller_inline
2727
; CHECK-SAME: () #[[ATTR2:[0-9]+]] {
28-
; CHECK-NEXT: call void @streaming_callee()
28+
; CHECK-NEXT: call void @streaming_compatible_f()
29+
; CHECK-NEXT: call void @streaming_compatible_f()
2930
; CHECK-NEXT: ret void
3031
;
31-
call void @streaming_callee()
32+
call void @non_streaming_callee()
3233
ret void
3334
}
3435

3536
; Don't inline call to @streaming_callee when the inline-threshold is set to 1, because it does not eliminate a streaming-mode change.
36-
define void @streaming_caller_dont_inline() #0 "aarch64_pstate_sm_enabled" {
37-
; CHECK-LABEL: define void @streaming_caller_dont_inline
37+
define void @non_streaming_caller_dont_inline() #0 {
38+
; CHECK-LABEL: define void @non_streaming_caller_dont_inline
3839
; CHECK-SAME: () #[[ATTR1]] {
39-
; CHECK-NEXT: call void @streaming_callee()
40+
; CHECK-NEXT: call void @non_streaming_callee()
4041
; CHECK-NEXT: ret void
4142
;
42-
call void @streaming_callee()
43+
call void @non_streaming_callee()
4344
ret void
4445
}
4546

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

Lines changed: 41 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -583,67 +583,67 @@ entry:
583583

584584

585585

586-
declare void @streaming_body() "aarch64_pstate_sm_enabled"
586+
declare void @nonstreaming_body()
587587

588-
define void @streaming_caller_single_streaming_callee() #0 "aarch64_pstate_sm_enabled" {
589-
; CHECK-LABEL: define void @streaming_caller_single_streaming_callee
590-
; CHECK-SAME: () #[[ATTR2]] {
591-
; CHECK-NEXT: call void @streaming_body()
588+
define void @nonstreaming_caller_single_nonstreaming_callee() #0 {
589+
; CHECK-LABEL: define void @nonstreaming_caller_single_nonstreaming_callee
590+
; CHECK-SAME: () #[[ATTR1]] {
591+
; CHECK-NEXT: call void @nonstreaming_body()
592592
; CHECK-NEXT: ret void
593593
;
594-
call void @streaming_body()
594+
call void @nonstreaming_body()
595595
ret void
596596
}
597597

598-
define void @streaming_caller_multiple_streaming_callees() #0 "aarch64_pstate_sm_enabled" {
599-
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_callees
600-
; CHECK-SAME: () #[[ATTR2]] {
601-
; CHECK-NEXT: call void @streaming_body()
602-
; CHECK-NEXT: call void @streaming_body()
598+
define void @nonstreaming_caller_multiple_nonstreaming_callees() #0 {
599+
; CHECK-LABEL: define void @nonstreaming_caller_multiple_nonstreaming_callees
600+
; CHECK-SAME: () #[[ATTR1]] {
601+
; CHECK-NEXT: call void @nonstreaming_body()
602+
; CHECK-NEXT: call void @nonstreaming_body()
603603
; CHECK-NEXT: ret void
604604
;
605-
call void @streaming_body()
606-
call void @streaming_body()
605+
call void @nonstreaming_body()
606+
call void @nonstreaming_body()
607607
ret void
608608
}
609609

610610
; Allow inlining, as inline it would not increase the number of streaming-mode changes.
611-
define void @streaming_caller_single_streaming_callee_inline() #0 {
611+
define void @streaming_caller_to_nonstreaming_callee_with_single_nonstreaming_callee_inline() #0 "aarch64_pstate_sm_enabled" {
612612
; CHECK-LABEL: define void @streaming_caller_single_streaming_callee_inline
613-
; CHECK-SAME: () #[[ATTR1]] {
614-
; CHECK-NEXT: call void @streaming_caller_single_streaming_callee()
613+
; CHECK-SAME: () #[[ATTR2]] {
614+
; CHECK-NEXT: call void @nonstreaming_body()
615615
; CHECK-NEXT: ret void
616616
;
617-
call void @streaming_caller_single_streaming_callee()
617+
call void @nonstreaming_caller_single_nonstreaming_callee()
618618
ret void
619619
}
620620

621-
; Prevent inlining, as inline it would lead to multiple streaming-mode changes.
622-
define void @streaming_caller_multiple_streaming_callees_dont_inline() #0 {
623-
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_callees_dont_inline
624-
; CHECK-SAME: () #[[ATTR1]] {
625-
; CHECK-NEXT: call void @streaming_caller_multiple_streaming_callees()
621+
; Prevent inlining, as inlining it would lead to multiple streaming-mode changes.
622+
define void @streaming_caller_to_nonstreaming_callee_with_multiple_nonstreaming_callees_dont_inline() #0 "aarch64_pstate_sm_enabled" {
623+
; CHECK-LABEL: define void @call_to_nonstreaming_caller_with_multiple_nonstreaming_callees_dont_inline
624+
; CHECK-SAME: () #[[ATTR2]] {
625+
; CHECK-NEXT: call void @nonstreaming_caller_multiple_nonstreaming_callees()
626626
; CHECK-NEXT: ret void
627627
;
628-
call void @streaming_caller_multiple_streaming_callees()
628+
call void @streaming_caller_to_nonstreaming_callee_with_multiple_nonstreaming_callees_dont_inline()
629629
ret void
630630
}
631631

632632
declare void @streaming_compatible_body() "aarch64_pstate_sm_compatible"
633633

634-
define void @streaming_caller_single_streaming_compatible_callee() #0 "aarch64_pstate_sm_enabled" {
635-
; CHECK-LABEL: define void @streaming_caller_single_streaming_compatible_callee
636-
; CHECK-SAME: () #[[ATTR2]] {
634+
define void @nonstreaming_caller_single_streaming_compatible_callee() #0 {
635+
; CHECK-LABEL: define void @nonstreaming_caller_single_streaming_compatible_callee
636+
; CHECK-SAME: () #[[ATTR1]] {
637637
; CHECK-NEXT: call void @streaming_compatible_body()
638638
; CHECK-NEXT: ret void
639639
;
640640
call void @streaming_compatible_body()
641641
ret void
642642
}
643643

644-
define void @streaming_caller_multiple_streaming_compatible_callees() #0 "aarch64_pstate_sm_enabled" {
645-
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_compatible_callees
646-
; CHECK-SAME: () #[[ATTR2]] {
644+
define void @nonstreaming_caller_multiple_streaming_compatible_callees() #0 {
645+
; CHECK-LABEL: define void @nonstreaming_caller_multiple_streaming_compatible_callees
646+
; CHECK-SAME: () #[[ATTR1]] {
647647
; CHECK-NEXT: call void @streaming_compatible_body()
648648
; CHECK-NEXT: call void @streaming_compatible_body()
649649
; CHECK-NEXT: ret void
@@ -654,24 +654,25 @@ define void @streaming_caller_multiple_streaming_compatible_callees() #0 "aarch
654654
}
655655

656656
; Allow inlining, as inline would remove a streaming-mode change.
657-
define void @streaming_caller_single_streaming_compatible_callee_inline() #0 {
658-
; CHECK-LABEL: define void @streaming_caller_single_streaming_compatible_callee_inline
659-
; CHECK-SAME: () #[[ATTR1]] {
660-
; CHECK-NEXT: call void @streaming_caller_single_streaming_compatible_callee()
657+
define void @streaming_caller_to_nonstreaming_callee_with_single_streamingcompatible_callee_inline() #0 "aarch64_pstate_sm_enabled" {
658+
; CHECK-LABEL: define void @streaming_caller_to_nonstreaming_callee_with_single_streamingcompatible_callee_inline
659+
; CHECK-SAME: () #[[ATTR2]] {
660+
; CHECK-NEXT: call void @streaming_compatible_body()
661661
; CHECK-NEXT: ret void
662662
;
663-
call void @streaming_caller_single_streaming_compatible_callee()
663+
call void @nonstreaming_caller_single_streaming_compatible_callee()
664664
ret void
665665
}
666666

667-
; Allow inlining, as inline would remove several stremaing-mode changes.
668-
define void @streaming_caller_multiple_streaming_compatible_callees_inline() #0 {
669-
; CHECK-LABEL: define void @streaming_caller_multiple_streaming_compatible_callees_inline
670-
; CHECK-SAME: () #[[ATTR1]] {
671-
; CHECK-NEXT: call void @streaming_caller_multiple_streaming_compatible_callees()
667+
; Allow inlining, as inline would remove several streaming-mode changes.
668+
define void @streaming_caller_to_nonstreaming_callee_with_multiple_streamingcompatible_callees_inline() #0 "aarch64_pstate_sm_enabled" {
669+
; CHECK-LABEL: define void @streaming_caller_to_nonstreaming_callee_with_multiple_streamingcompatible_callees_inline
670+
; CHECK-SAME: () #[[ATTR2]] {
671+
; CHECK-NEXT: call void @streaming_compatible_body()
672+
; CHECK-NEXT: call void @streaming_compatible_body()
672673
; CHECK-NEXT: ret void
673674
;
674-
call void @streaming_caller_multiple_streaming_compatible_callees()
675+
call void @nonstreaming_caller_multiple_streaming_compatible_callees()
675676
ret void
676677
}
677678

0 commit comments

Comments
 (0)