File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed
test/CodeGen/aarch64-sme-func-attrs-inline Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,8 @@ def err_function_needs_feature : Error<
281
281
"be inlined into function %0 that is compiled without support for '%2'">;
282
282
def err_function_always_inline_attribute_mismatch : Error<
283
283
"always_inline function %1 and its caller %0 have mismatched %2 attributes">;
284
+ def err_function_always_inline_new_za : Error<
285
+ "always_inline function %0 has new za state">;
284
286
285
287
def warn_avx_calling_convention
286
288
: Warning<"AVX vector %select{return|argument}0 of type %1 without '%2' "
Original file line number Diff line number Diff line change @@ -831,6 +831,10 @@ void AArch64TargetCodeGenInfo::checkFunctionCallABI(
831
831
llvm::SMEAttrs FAttrs;
832
832
if (F->hasAttr <ArmLocallyStreamingAttr>())
833
833
FAttrs.set (llvm::SMEAttrs::Mask::SM_Enabled);
834
+ if (auto *NewAttr = F->getAttr <ArmNewAttr>()) {
835
+ if (NewAttr->isNewZA ())
836
+ FAttrs.set (llvm::SMEAttrs::Mask::ZA_New);
837
+ }
834
838
if (const auto *T = F->getType ()->getAs <FunctionProtoType>()) {
835
839
if (T->getAArch64SMEAttributes () & FunctionType::SME_PStateSMEnabledMask)
836
840
FAttrs.set (llvm::SMEAttrs::Mask::SM_Enabled);
@@ -848,6 +852,9 @@ void AArch64TargetCodeGenInfo::checkFunctionCallABI(
848
852
CGM.getDiags ().Report (CallLoc,
849
853
diag::err_function_always_inline_attribute_mismatch)
850
854
<< Caller->getDeclName () << Callee->getDeclName () << " streaming" ;
855
+ if (CalleeAttrs.hasNewZABody ())
856
+ CGM.getDiags ().Report (CallLoc, diag::err_function_always_inline_new_za)
857
+ << Callee->getDeclName ();
851
858
}
852
859
853
860
std::unique_ptr<TargetCodeGenInfo>
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
+ __attribute__((always_inline )) __arm_new ("za" )
4
+ void inline_new_za (void ) { }
5
+ // expected-error@+1 {{always_inline function 'inline_new_za' has new za state}}
6
+ void inline_caller () { inline_new_za (); }
You can’t perform that action at this time.
0 commit comments