1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sme,+sve -verify-machineinstrs --pass-remarks-analysis=sme -o /dev/null < %s 2>&1 | FileCheck %s
3 declare void @normal_callee()
4 declare void @streaming_callee() "aarch64_pstate_sm_enabled"
5 declare void @streaming_compatible_callee() "aarch64_pstate_sm_compatible"
7 ; CHECK: remark: <unknown>:0:0: call from 'normal_caller_streaming_callee' to 'streaming_callee' requires a streaming mode transition
8 define void @normal_caller_streaming_callee() nounwind {
9 call void @streaming_callee()
13 ; CHECK: remark: <unknown>:0:0: call from 'streaming_caller_normal_callee' to 'normal_callee' requires a streaming mode transition
14 define void @streaming_caller_normal_callee() nounwind "aarch64_pstate_sm_enabled" {
15 call void @normal_callee()
19 ; CHECK-NOT: streaming_caller_streaming_callee
20 define void @streaming_caller_streaming_callee() nounwind "aarch64_pstate_sm_enabled" {
21 call void @streaming_callee()
25 ; CHECK-NOT: streaming_caller_streaming_compatible_callee
26 define void @streaming_caller_streaming_compatible_callee() nounwind "aarch64_pstate_sm_enabled" {
27 call void @streaming_compatible_callee()
31 ; CHECK: remark: <unknown>:0:0: call from 'call_to_function_pointer_streaming_enabled' to 'unknown callee' requires a streaming mode transition
32 define void @call_to_function_pointer_streaming_enabled(ptr %p) nounwind {
33 call void %p() "aarch64_pstate_sm_enabled"
37 ; CHECK: remark: <unknown>:0:0: call from 'smstart_clobber_simdfp' to 'streaming_callee' requires a streaming mode transition
38 define <4 x i32> @smstart_clobber_simdfp(<4 x i32> %x) nounwind {
39 call void @streaming_callee()
43 ; CHECK: remark: <unknown>:0:0: call from 'smstart_clobber_sve' to 'streaming_callee' requires a streaming mode transition
44 define <vscale x 4 x i32> @smstart_clobber_sve(<vscale x 4 x i32> %x) nounwind {
45 call void @streaming_callee()
46 ret <vscale x 4 x i32> %x;
49 ; CHECK: remark: <unknown>:0:0: call from 'smstart_clobber_sve_duplicate' to 'streaming_callee' requires a streaming mode transition
50 ; CHECK: remark: <unknown>:0:0: call from 'smstart_clobber_sve_duplicate' to 'streaming_callee' requires a streaming mode transition
51 define <vscale x 4 x i32> @smstart_clobber_sve_duplicate(<vscale x 4 x i32> %x) nounwind {
52 call void @streaming_callee()
53 call void @streaming_callee()
54 ret <vscale x 4 x i32> %x;
57 ; CHECK: remark: <unknown>:0:0: call from 'call_to_intrinsic_without_chain' to 'cos' requires a streaming mode transition
58 define double @call_to_intrinsic_without_chain(double %x) nounwind "aarch64_pstate_sm_enabled" {
60 %res = call fast double @llvm.cos.f64(double %x)
61 %res.fadd = fadd fast double %res, %x
65 declare double @llvm.cos.f64(double)
67 ; CHECK: remark: <unknown>:0:0: call from 'disable_tailcallopt' to 'streaming_callee' requires a streaming mode transition
68 define void @disable_tailcallopt() nounwind {
69 tail call void @streaming_callee()
73 ; CHECK: remark: <unknown>:0:0: call from 'call_to_non_streaming_pass_sve_objects' to 'foo' requires a streaming mode transition
74 define i8 @call_to_non_streaming_pass_sve_objects(ptr nocapture noundef readnone %ptr) #0 {
76 %Data1 = alloca <vscale x 16 x i8>, align 16
77 %Data2 = alloca <vscale x 16 x i8>, align 16
78 %Data3 = alloca <vscale x 16 x i8>, align 16
79 %0 = tail call i64 @llvm.aarch64.sme.cntsb()
80 call void @foo(ptr noundef nonnull %Data1, ptr noundef nonnull %Data2, ptr noundef nonnull %Data3, i64 noundef %0)
81 %1 = load <vscale x 16 x i8>, ptr %Data1, align 16
82 %vecext = extractelement <vscale x 16 x i8> %1, i64 0
86 declare i64 @llvm.aarch64.sme.cntsb()
88 declare void @foo(ptr noundef, ptr noundef, ptr noundef, i64 noundef)
90 attributes #0 = { nounwind vscale_range(1,16) "aarch64_pstate_sm_enabled" }