LLVM 18.0.0git
|
SMEAttrs is a utility class to parse the SME ACLE attributes on functions. More...
#include "Target/AArch64/Utils/AArch64SMEAttributes.h"
Public Types | |
enum | Mask { Normal = 0 , SM_Enabled = 1 << 0 , SM_Compatible = 1 << 1 , SM_Body = 1 << 2 , ZA_Shared = 1 << 3 , ZA_New = 1 << 4 , ZA_Preserved = 1 << 5 , ZA_NoLazySave = 1 << 6 , All = ZA_Preserved - 1 } |
Public Member Functions | |
SMEAttrs (unsigned Mask=Normal) | |
SMEAttrs (const Function &F) | |
SMEAttrs (const CallBase &CB) | |
SMEAttrs (const AttributeList &L) | |
SMEAttrs (StringRef FuncName) | |
void | set (unsigned M, bool Enable=true) |
bool | hasStreamingBody () const |
bool | hasStreamingInterface () const |
bool | hasStreamingInterfaceOrBody () const |
bool | hasStreamingCompatibleInterface () const |
bool | hasNonStreamingInterface () const |
bool | hasNonStreamingInterfaceAndBody () const |
std::optional< bool > | requiresSMChange (const SMEAttrs &Callee, bool BodyOverridesInterface=false) const |
bool | hasNewZABody () const |
bool | hasSharedZAInterface () const |
bool | hasPrivateZAInterface () const |
bool | preservesZA () const |
bool | hasZAState () const |
bool | requiresLazySave (const SMEAttrs &Callee) const |
SMEAttrs is a utility class to parse the SME ACLE attributes on functions.
It helps determine a function's requirements for PSTATE.ZA and PSTATE.SM. It has interfaces to query whether a streaming mode change or lazy-save mechanism is required when going from one function to another (e.g. through a call).
Definition at line 25 of file AArch64SMEAttributes.h.
enum llvm::SMEAttrs::Mask |
Enumerator | |
---|---|
Normal | |
SM_Enabled | |
SM_Compatible | |
SM_Body | |
ZA_Shared | |
ZA_New | |
ZA_Preserved | |
ZA_NoLazySave | |
All |
Definition at line 30 of file AArch64SMEAttributes.h.
Definition at line 42 of file AArch64SMEAttributes.h.
References set().
Definition at line 43 of file AArch64SMEAttributes.h.
Definition at line 33 of file AArch64SMEAttributes.cpp.
References F, llvm::CallBase::getAttributes(), llvm::CallBase::getCalledFunction(), and set().
SMEAttrs::SMEAttrs | ( | const AttributeList & | L | ) |
Definition at line 49 of file AArch64SMEAttributes.cpp.
References SM_Body, SM_Compatible, SM_Enabled, ZA_New, ZA_Preserved, and ZA_Shared.
SMEAttrs::SMEAttrs | ( | StringRef | FuncName | ) |
Definition at line 40 of file AArch64SMEAttributes.cpp.
References SM_Compatible, ZA_NoLazySave, ZA_Preserved, and ZA_Shared.
|
inline |
Definition at line 78 of file AArch64SMEAttributes.h.
References ZA_New.
Referenced by llvm::AArch64TTIImpl::areInlineCompatible(), hasZAState(), and set().
|
inline |
Definition at line 59 of file AArch64SMEAttributes.h.
References hasStreamingCompatibleInterface(), and hasStreamingInterface().
Referenced by hasNonStreamingInterfaceAndBody().
|
inline |
Definition at line 62 of file AArch64SMEAttributes.h.
References hasNonStreamingInterface(), and hasStreamingBody().
Referenced by requiresSMChange().
|
inline |
Definition at line 80 of file AArch64SMEAttributes.h.
References hasSharedZAInterface().
|
inline |
Definition at line 79 of file AArch64SMEAttributes.h.
References ZA_Shared.
Referenced by hasPrivateZAInterface(), hasZAState(), and set().
|
inline |
Definition at line 51 of file AArch64SMEAttributes.h.
References SM_Body.
Referenced by hasNonStreamingInterfaceAndBody(), and hasStreamingInterfaceOrBody().
|
inline |
Definition at line 56 of file AArch64SMEAttributes.h.
References SM_Compatible.
Referenced by llvm::AArch64::createFastISel(), hasNonStreamingInterface(), and set().
|
inline |
Definition at line 52 of file AArch64SMEAttributes.h.
References SM_Enabled.
Referenced by hasNonStreamingInterface(), hasStreamingInterfaceOrBody(), and set().
|
inline |
Definition at line 53 of file AArch64SMEAttributes.h.
References hasStreamingBody(), and hasStreamingInterface().
Referenced by llvm::AArch64::createFastISel(), and requiresSMChange().
|
inline |
Definition at line 82 of file AArch64SMEAttributes.h.
References hasNewZABody(), and hasSharedZAInterface().
Referenced by llvm::AArch64::createFastISel(), and requiresLazySave().
|
inline |
Definition at line 85 of file AArch64SMEAttributes.h.
References hasZAState(), and ZA_NoLazySave.
Referenced by llvm::AArch64TTIImpl::areInlineCompatible().
std::optional< bool > SMEAttrs::requiresSMChange | ( | const SMEAttrs & | Callee, |
bool | BodyOverridesInterface = false |
||
) | const |
BodyOverridesInterface
is true and Callee has a streaming body, then requiresSMChange considers a call to Callee as having a Streaming interface. This can be useful when considering e.g. inlining, where we explicitly want the body to overrule the interface (because after inlining the interface is no longer relevant). Definition at line 66 of file AArch64SMEAttributes.cpp.
References hasNonStreamingInterfaceAndBody(), and hasStreamingInterfaceOrBody().
Referenced by llvm::AArch64TTIImpl::areInlineCompatible(), and llvm::AArch64TTIImpl::getInlineCallPenalty().
Definition at line 15 of file AArch64SMEAttributes.cpp.
References assert(), llvm::Enable, hasNewZABody(), hasSharedZAInterface(), hasStreamingCompatibleInterface(), hasStreamingInterface(), preservesZA(), and ZA_NoLazySave.
Referenced by SMEAttrs().