LLVM 19.0.0git
Public Types | Public Member Functions | Static 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 class  StateValue {
  None = 0 , In = 1 , Out = 2 , InOut = 3 ,
  Preserved = 4 , New = 5
}
 
enum  Mask {
  Normal = 0 , SM_Enabled = 1 << 0 , SM_Compatible = 1 << 1 , SM_Body = 1 << 2 ,
  SME_ABI_Routine = 1 << 3 , ZA_Shift = 4 , ZA_Mask = 0b111 << ZA_Shift , ZT0_Shift = 7 ,
  ZT0_Mask = 0b111 << ZT0_Shift
}
 

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
 
bool requiresSMChange (const SMEAttrs &Callee) const
 
bool isNewZA () const
 
bool isInZA () const
 
bool isOutZA () const
 
bool isInOutZA () const
 
bool isPreservesZA () const
 
bool sharesZA () const
 
bool hasSharedZAInterface () const
 
bool hasPrivateZAInterface () const
 
bool hasZAState () const
 
bool requiresLazySave (const SMEAttrs &Callee) const
 
bool isNewZT0 () const
 
bool isInZT0 () const
 
bool isOutZT0 () const
 
bool isInOutZT0 () const
 
bool isPreservesZT0 () const
 
bool sharesZT0 () const
 
bool hasZT0State () const
 
bool requiresPreservingZT0 (const SMEAttrs &Callee) const
 
bool requiresDisablingZABeforeCall (const SMEAttrs &Callee) const
 
bool requiresEnablingZAAfterCall (const SMEAttrs &Callee) const
 

Static Public Member Functions

static StateValue decodeZAState (unsigned Bitmask)
 
static unsigned encodeZAState (StateValue S)
 
static StateValue decodeZT0State (unsigned Bitmask)
 
static unsigned encodeZT0State (StateValue S)
 

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 
SME_ABI_Routine 
ZA_Shift 
ZA_Mask 
ZT0_Shift 
ZT0_Mask 

Definition at line 39 of file AArch64SMEAttributes.h.

◆ StateValue

enum class llvm::SMEAttrs::StateValue
strong
Enumerator
None 
In 
Out 
InOut 
Preserved 
New 

Definition at line 29 of file AArch64SMEAttributes.h.

Constructor & Destructor Documentation

◆ SMEAttrs() [1/5]

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

Definition at line 51 of file AArch64SMEAttributes.h.

References set().

◆ SMEAttrs() [2/5]

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

Definition at line 52 of file AArch64SMEAttributes.h.

◆ SMEAttrs() [3/5]

SMEAttrs::SMEAttrs ( const CallBase CB)

◆ SMEAttrs() [4/5]

SMEAttrs::SMEAttrs ( const AttributeList L)

◆ SMEAttrs() [5/5]

SMEAttrs::SMEAttrs ( StringRef  FuncName)

Definition at line 50 of file AArch64SMEAttributes.cpp.

References encodeZAState(), In, SM_Compatible, and SME_ABI_Routine.

Member Function Documentation

◆ decodeZAState()

static StateValue llvm::SMEAttrs::decodeZAState ( unsigned  Bitmask)
inlinestatic

Definition at line 80 of file AArch64SMEAttributes.h.

References ZA_Mask, and ZA_Shift.

Referenced by isInOutZA(), isInZA(), isNewZA(), isOutZA(), isPreservesZA(), and sharesZA().

◆ decodeZT0State()

static StateValue llvm::SMEAttrs::decodeZT0State ( unsigned  Bitmask)
inlinestatic

Definition at line 108 of file AArch64SMEAttributes.h.

References ZT0_Mask, and ZT0_Shift.

Referenced by isInOutZT0(), isInZT0(), isNewZT0(), isOutZT0(), isPreservesZT0(), and sharesZT0().

◆ encodeZAState()

static unsigned llvm::SMEAttrs::encodeZAState ( StateValue  S)
inlinestatic

Definition at line 83 of file AArch64SMEAttributes.h.

References ZA_Shift.

Referenced by SMEAttrs().

◆ encodeZT0State()

static unsigned llvm::SMEAttrs::encodeZT0State ( StateValue  S)
inlinestatic

Definition at line 111 of file AArch64SMEAttributes.h.

References ZT0_Shift.

Referenced by SMEAttrs().

◆ hasNonStreamingInterface()

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

◆ hasNonStreamingInterfaceAndBody()

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

Definition at line 71 of file AArch64SMEAttributes.h.

References hasNonStreamingInterface(), and hasStreamingBody().

Referenced by requiresSMChange().

◆ hasPrivateZAInterface()

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

Definition at line 100 of file AArch64SMEAttributes.h.

References hasSharedZAInterface().

◆ hasSharedZAInterface()

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

Definition at line 99 of file AArch64SMEAttributes.h.

References sharesZA(), and sharesZT0().

Referenced by hasPrivateZAInterface().

◆ hasStreamingBody()

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

◆ hasStreamingCompatibleInterface()

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

◆ hasStreamingInterface()

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

◆ hasStreamingInterfaceOrBody()

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

◆ hasZAState()

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

◆ hasZT0State()

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

◆ isInOutZA()

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

Definition at line 90 of file AArch64SMEAttributes.h.

References decodeZAState(), and InOut.

Referenced by set().

◆ isInOutZT0()

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

Definition at line 118 of file AArch64SMEAttributes.h.

References decodeZT0State(), and InOut.

Referenced by set().

◆ isInZA()

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

Definition at line 88 of file AArch64SMEAttributes.h.

References decodeZAState(), and In.

Referenced by set().

◆ isInZT0()

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

Definition at line 116 of file AArch64SMEAttributes.h.

References decodeZT0State(), and In.

Referenced by set().

◆ isNewZA()

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

Definition at line 87 of file AArch64SMEAttributes.h.

References decodeZAState(), and New.

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

◆ isNewZT0()

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

Definition at line 115 of file AArch64SMEAttributes.h.

References decodeZT0State(), and New.

Referenced by hasZT0State(), and set().

◆ isOutZA()

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

Definition at line 89 of file AArch64SMEAttributes.h.

References decodeZAState(), and Out.

Referenced by set().

◆ isOutZT0()

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

Definition at line 117 of file AArch64SMEAttributes.h.

References decodeZT0State(), and Out.

Referenced by set().

◆ isPreservesZA()

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

Definition at line 91 of file AArch64SMEAttributes.h.

References decodeZAState(), and Preserved.

Referenced by set().

◆ isPreservesZT0()

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

Definition at line 121 of file AArch64SMEAttributes.h.

References decodeZT0State(), and Preserved.

Referenced by set().

◆ requiresDisablingZABeforeCall()

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

Definition at line 133 of file AArch64SMEAttributes.h.

References hasZAState(), hasZT0State(), and SME_ABI_Routine.

Referenced by requiresEnablingZAAfterCall().

◆ requiresEnablingZAAfterCall()

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

Definition at line 137 of file AArch64SMEAttributes.h.

References requiresDisablingZABeforeCall(), and requiresLazySave().

◆ requiresLazySave()

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

Definition at line 102 of file AArch64SMEAttributes.h.

References hasZAState(), and SME_ABI_Routine.

Referenced by requiresEnablingZAAfterCall().

◆ requiresPreservingZT0()

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

Definition at line 130 of file AArch64SMEAttributes.h.

References hasZT0State().

◆ requiresSMChange()

bool SMEAttrs::requiresSMChange ( const SMEAttrs Callee) const
Returns
true if a call from Caller -> Callee requires a change in streaming mode.

Definition at line 88 of file AArch64SMEAttributes.cpp.

References hasNonStreamingInterfaceAndBody(), and hasStreamingInterfaceOrBody().

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

◆ set()

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

◆ sharesZA()

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

Definition at line 94 of file AArch64SMEAttributes.h.

References decodeZAState(), In, InOut, Out, and Preserved.

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

◆ sharesZT0()

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

Definition at line 124 of file AArch64SMEAttributes.h.

References decodeZT0State(), In, InOut, Out, and Preserved.

Referenced by hasSharedZAInterface(), hasZT0State(), and set().


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