[clang] [Clang] Amend SME attributes with support for ZT0. (PR #77941)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 17 03:06:31 PST 2024


================
@@ -4253,7 +4260,7 @@ class FunctionProtoType final
     FunctionType::ExtInfo ExtInfo;
     unsigned Variadic : 1;
     unsigned HasTrailingReturn : 1;
-    unsigned AArch64SMEAttributes : 6;
----------------
sdesmalen-arm wrote:

Thanks for both your input! The Arm attributes will probably be used reasonably sparsely in the sense that they particularly target code to optimise using SME intrinsics/state. By not adding the attribute it will be a normal function that does not share any SME state. So I agree it makes sense to refactor the code a bit such that these attributes don't affect code that does not use any of these attributes.

I've created #78424 to do this, so that the Arm SME attributes will have their own TrailingObject and are therefore only allocated when a function uses the attributes. I hope that addresses the concerns! (When that patch lands, I'll rebase this one)

It will be more difficult to do something for ExtProtoInfo, given how this is designed, but as @AaronBallman says the struct is already huge and is allocated as-needed. My experiment showed that adding more bits didn't make a practical difference to the size of the ExtProtoInfo. Not sure if this can differ between compilers, but I didn't see it expanding the struct by a byte.

https://github.com/llvm/llvm-project/pull/77941


More information about the cfe-commits mailing list