Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ SMECallAttrs::SMECallAttrs(const CallBase &CB,
if (auto *CalledFunction = CB.getCalledFunction())
CalledFn = SMEAttrs(*CalledFunction, RTLCI);

// An `invoke` of an agnostic ZA function may not return normally (it may
// resume in an exception block). In this case, it acts like a private ZA
// callee and may require a ZA save to be set up before it is called.
if (isa<InvokeInst>(CB))
CalledFn.set(SMEAttrs::ZA_State_Agnostic, /*Enable=*/false);

// FIXME: We probably should not allow SME attributes on direct calls but
// clang duplicates streaming mode attributes at each callsite.
assert((IsIndirect ||
((Callsite.withoutPerCallsiteFlags() | CalledFn) == CalledFn)) &&
"SME attributes at callsite do not match declaration");

// An `invoke` of an agnostic ZA function may not return normally (it may
// resume in an exception block). In this case, it acts like a private ZA
// callee and may require a ZA save to be set up before it is called.
if (isa<InvokeInst>(CB))
CalledFn.set(SMEAttrs::ZA_State_Agnostic, /*Enable=*/false);
}
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AArch64/sme-za-exceptions.ll
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ define void @try_catch_agnostic_za_invoke() "aarch64_za_state_agnostic" personal
; CHECK-SDAG-NEXT: bl __arm_sme_restore
; CHECK-SDAG-NEXT: b .LBB5_1
entry:
invoke void @agnostic_za_call()
invoke void @agnostic_za_call() "aarch64_za_state_agnostic"
to label %exit unwind label %catch

catch:
Expand Down