File tree Expand file tree Collapse file tree 5 files changed +32
-5
lines changed
test/CodeGen/aarch64-sme-func-attrs-inline Expand file tree Collapse file tree 5 files changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -827,12 +827,13 @@ void AArch64TargetCodeGenInfo::checkFunctionCallABI(
827
827
if (!Callee->hasAttr <AlwaysInlineAttr>())
828
828
return ;
829
829
830
- auto CalleeIsStreaming =
831
- Sema::getArmStreamingFnType (Callee) == Sema::ArmStreaming;
832
- auto CallerIsStreaming =
833
- Sema::getArmStreamingFnType (Caller) == Sema::ArmStreaming;
830
+ auto CalleeStreamingMode = Sema::getArmStreamingFnType (Callee);
831
+ auto CallerStreamingMode = Sema::getArmStreamingFnType (Caller);
834
832
835
- if (CalleeIsStreaming && !CallerIsStreaming)
833
+ // The caller can inline the callee if their streaming modes match or the
834
+ // callee is streaming compatible
835
+ if (CalleeStreamingMode != CallerStreamingMode &&
836
+ CalleeStreamingMode != Sema::ArmStreamingCompatible)
836
837
CGM.getDiags ().Report (CallLoc,
837
838
diag::err_function_alwaysinline_attribute_mismatch)
838
839
<< Caller->getDeclName () << Callee->getDeclName () << " streaming" ;
Original file line number Diff line number Diff line change
1
+ // RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s
2
+
3
+ // Conflicting attributes when using always_inline
4
+ __attribute__((always_inline ))
5
+ int inlined_fn_streaming (void ) __arm_streaming {
6
+ return 42 ;
7
+ }
8
+ // expected-error@+1 {{always_inline function 'inlined_fn_streaming' and its caller 'inlined_fn_caller' have mismatched streaming attributes}}
9
+ int inlined_fn_caller (void ) __arm_streaming_compatible { return inlined_fn_streaming (); }
Original file line number Diff line number Diff line change
1
+ // RUN: %clang --target=aarch64-none-linux-gnu -march=armv9-a+sme -O3 -S -Xclang -verify %s
2
+
3
+ // Conflicting attributes when using always_inline
4
+ __attribute__((always_inline ))
5
+ int inlined_fn_streaming_compatible (void ) __arm_streaming_compatible {
6
+ return 42 ;
7
+ }
8
+ __attribute__((always_inline ))
9
+ int inlined_fn (void ) {
10
+ return 42 ;
11
+ }
12
+ int inlined_fn_caller (void ) { return inlined_fn_streaming_compatible (); }
13
+ __arm_locally_streaming
14
+ int inlined_fn_caller_local (void ) { return inlined_fn_streaming_compatible (); }
15
+ int inlined_fn_caller_streaming (void ) __arm_streaming { return inlined_fn_streaming_compatible (); }
16
+ // expected-error@+1 {{always_inline function 'inlined_fn' and its caller 'inlined_fn_caller_compatible' have mismatched streaming attributes}}
17
+ int inlined_fn_caller_compatible (void ) __arm_streaming_compatible { return inlined_fn (); }
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments