Introduce 'amxpreserve' attribute to reduce save/restore AMX register in register allocation. Use this attribute to indicate that the specified function has no caller-saved AMX registers. Compiler doesn't save and restore any AMX register across function call. It is user's responsibility that ensure there is no AMX register clobber in the function with "amxpreserve" attribute. Like 'no_caller_saved_registers', 'amxpreserve' attribute is not a calling convention. In fact, it only overrides the decision of which AMX registers should be saved by the caller. For example: .. code-block:: c __attribute__ ((amxpreserve )) void f () { ... } void bar () { ... f(); ... } In this case compiler doesn't save and restore AMX registers across the call of f().
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Basic/Attr.td | ||
---|---|---|
2895 | Inherited on what? This attribute needs a Subjects list, I suspect, or it needs to not be using a SimpleHandler. | |
2896 | Does GCC support this attribute? Or MSVC? I don't see any evidence that either compiler supports this, so I think this should be one spelling: Clang. | |
2897 | No new, undocumented attributes please. | |
clang/lib/Sema/SemaType.cpp | ||
7518 | Why are there type system changes for a declaration attribute? |
I'm worried about the extra overhead imposed on all users by this change. This appears to be adding another calling convention to Clang (despite the claim that it's not); can you share a motivation for why everyone should pay the price for adding it?
clang/include/clang/AST/Type.h | ||
---|---|---|
1588 | This is problematic because it increases the cost of forming a type. | |
1826 | (From comment above) this means that every type is now more expensive to create and that has cascading effects on things like template instantiation depth and memory pressures for all users, including people not using this feature. |
This is problematic because it increases the cost of forming a type.