[clang] [AArch64][Clang] Add support for __arm_agnostic("sme_za_state") (PR #121788)
Richard Sandiford via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 7 04:19:39 PST 2025
================
@@ -7559,6 +7559,26 @@ The attributes ``__arm_in(S)``, ``__arm_out(S)``, ``__arm_inout(S)`` and
}];
}
+def ArmAgnosticDocs : Documentation {
+ let Category = DocCatArmSmeAttributes;
+ let Content = [{
+The ``__arm_agnostic`` keyword applies to prototyped function types and
+specifies that the function is agnostic about the given state S and
----------------
rsandifo-arm wrote:
I wonder whether “is agnostic about” will mean much to someone who doesn't already know what the attribute does. Perhaps we should instead present this as an alternative calling convention for functions that do not share particular state with their callers.
That is, the effect of calling:
```
void f(void) __attribute__((arm_agnostic("sme")));
```
on C/C++ SME state is equivalent to calling:
```
void f(void);
```
since both share no SME state with their callers. But if these two `f`s were exposed at ABI boundaries, they would have different calling conventions, and the object code would take a different approach to managing the state.
(That isn't suggested wording! Just trying to describe what I mean.)
https://github.com/llvm/llvm-project/pull/121788
More information about the cfe-commits
mailing list