LLVM 18.0.0git
Public Types | Public Member Functions | List of all members
llvm::SMEAttrs Class Reference

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< boolrequiresSMChange (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
 

Detailed Description

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.

Member Enumeration Documentation

◆ 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.

Constructor & Destructor Documentation

◆ SMEAttrs() [1/5]

llvm::SMEAttrs::SMEAttrs ( unsigned  Mask = Normal)
inline

Definition at line 42 of file AArch64SMEAttributes.h.

References set().

◆ SMEAttrs() [2/5]

llvm::SMEAttrs::SMEAttrs ( const Function F)
inline

Definition at line 43 of file AArch64SMEAttributes.h.

◆ SMEAttrs() [3/5]

SMEAttrs::SMEAttrs ( const CallBase CB)

◆ SMEAttrs() [4/5]

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() [5/5]

SMEAttrs::SMEAttrs ( StringRef  FuncName)

Definition at line 40 of file AArch64SMEAttributes.cpp.

References SM_Compatible, ZA_NoLazySave, ZA_Preserved, and ZA_Shared.

Member Function Documentation

◆ hasNewZABody()

bool llvm::SMEAttrs::hasNewZABody ( ) const
inline

Definition at line 78 of file AArch64SMEAttributes.h.

References ZA_New.

Referenced by llvm::AArch64TTIImpl::areInlineCompatible(), hasZAState(), and set().

◆ hasNonStreamingInterface()

bool llvm::SMEAttrs::hasNonStreamingInterface ( ) const
inline

◆ hasNonStreamingInterfaceAndBody()

bool llvm::SMEAttrs::hasNonStreamingInterfaceAndBody ( ) const
inline

Definition at line 62 of file AArch64SMEAttributes.h.

References hasNonStreamingInterface(), and hasStreamingBody().

Referenced by requiresSMChange().

◆ hasPrivateZAInterface()

bool llvm::SMEAttrs::hasPrivateZAInterface ( ) const
inline

Definition at line 80 of file AArch64SMEAttributes.h.

References hasSharedZAInterface().

◆ hasSharedZAInterface()

bool llvm::SMEAttrs::hasSharedZAInterface ( ) const
inline

Definition at line 79 of file AArch64SMEAttributes.h.

References ZA_Shared.

Referenced by hasPrivateZAInterface(), hasZAState(), and set().

◆ hasStreamingBody()

bool llvm::SMEAttrs::hasStreamingBody ( ) const
inline

Definition at line 51 of file AArch64SMEAttributes.h.

References SM_Body.

Referenced by hasNonStreamingInterfaceAndBody(), and hasStreamingInterfaceOrBody().

◆ hasStreamingCompatibleInterface()

bool llvm::SMEAttrs::hasStreamingCompatibleInterface ( ) const
inline

Definition at line 56 of file AArch64SMEAttributes.h.

References SM_Compatible.

Referenced by llvm::AArch64::createFastISel(), hasNonStreamingInterface(), and set().

◆ hasStreamingInterface()

bool llvm::SMEAttrs::hasStreamingInterface ( ) const
inline

Definition at line 52 of file AArch64SMEAttributes.h.

References SM_Enabled.

Referenced by hasNonStreamingInterface(), hasStreamingInterfaceOrBody(), and set().

◆ hasStreamingInterfaceOrBody()

bool llvm::SMEAttrs::hasStreamingInterfaceOrBody ( ) const
inline

◆ hasZAState()

bool llvm::SMEAttrs::hasZAState ( ) const
inline

◆ preservesZA()

bool llvm::SMEAttrs::preservesZA ( ) const
inline

Definition at line 81 of file AArch64SMEAttributes.h.

References ZA_Preserved.

Referenced by set().

◆ requiresLazySave()

bool llvm::SMEAttrs::requiresLazySave ( const SMEAttrs Callee) const
inline

Definition at line 85 of file AArch64SMEAttributes.h.

References hasZAState(), and ZA_NoLazySave.

Referenced by llvm::AArch64TTIImpl::areInlineCompatible().

◆ requiresSMChange()

std::optional< bool > SMEAttrs::requiresSMChange ( const SMEAttrs Callee,
bool  BodyOverridesInterface = false 
) const
Returns
true if a call from Caller -> Callee requires a change in streaming mode. If 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().

◆ set()

void SMEAttrs::set ( unsigned  M,
bool  Enable = true 
)

The documentation for this class was generated from the following files: