LLVM 17.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 , All = ZA_Preserved - 1

Public Member Functions

 SMEAttrs (unsigned Mask=Normal)
 SMEAttrs (const Function &F)
 SMEAttrs (const CallBase &CB)
 SMEAttrs (const AttributeList &L)
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 hasNewZAInterface () 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 24 of file AArch64SMEAttributes.h.

Member Enumeration Documentation

◆ Mask


Definition at line 29 of file AArch64SMEAttributes.h.

Constructor & Destructor Documentation

◆ SMEAttrs() [1/4]

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

Definition at line 40 of file AArch64SMEAttributes.h.

References set().

◆ SMEAttrs() [2/4]

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

Definition at line 41 of file AArch64SMEAttributes.h.

◆ SMEAttrs() [3/4]

SMEAttrs::SMEAttrs ( const CallBase CB)

◆ SMEAttrs() [4/4]

SMEAttrs::SMEAttrs ( const AttributeList L)

Definition at line 35 of file AArch64SMEAttributes.cpp.

References SM_Body, SM_Compatible, SM_Enabled, ZA_New, ZA_Preserved, and ZA_Shared.

Member Function Documentation

◆ hasNewZAInterface()

bool llvm::SMEAttrs::hasNewZAInterface ( ) const

Definition at line 75 of file AArch64SMEAttributes.h.

References ZA_New.

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

◆ hasNonStreamingInterface()

bool llvm::SMEAttrs::hasNonStreamingInterface ( ) const

◆ hasNonStreamingInterfaceAndBody()

bool llvm::SMEAttrs::hasNonStreamingInterfaceAndBody ( ) const

Definition at line 59 of file AArch64SMEAttributes.h.

References hasNonStreamingInterface(), and hasStreamingBody().

Referenced by requiresSMChange().

◆ hasPrivateZAInterface()

bool llvm::SMEAttrs::hasPrivateZAInterface ( ) const

Definition at line 77 of file AArch64SMEAttributes.h.

References hasSharedZAInterface().

◆ hasSharedZAInterface()

bool llvm::SMEAttrs::hasSharedZAInterface ( ) const

Definition at line 76 of file AArch64SMEAttributes.h.

References ZA_Shared.

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

◆ hasStreamingBody()

bool llvm::SMEAttrs::hasStreamingBody ( ) const

◆ hasStreamingCompatibleInterface()

bool llvm::SMEAttrs::hasStreamingCompatibleInterface ( ) const

Definition at line 53 of file AArch64SMEAttributes.h.

References SM_Compatible.

Referenced by hasNonStreamingInterface(), and set().

◆ hasStreamingInterface()

bool llvm::SMEAttrs::hasStreamingInterface ( ) const

◆ hasStreamingInterfaceOrBody()

bool llvm::SMEAttrs::hasStreamingInterfaceOrBody ( ) const

Definition at line 50 of file AArch64SMEAttributes.h.

References hasStreamingBody(), and hasStreamingInterface().

Referenced by requiresSMChange().

◆ hasZAState()

bool llvm::SMEAttrs::hasZAState ( ) const

◆ preservesZA()

bool llvm::SMEAttrs::preservesZA ( ) const

Definition at line 78 of file AArch64SMEAttributes.h.

References ZA_Preserved.

Referenced by set().

◆ requiresLazySave()

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

Definition at line 82 of file AArch64SMEAttributes.h.

References Callee, and hasZAState().

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

◆ requiresSMChange()

std::optional< bool > SMEAttrs::requiresSMChange ( const SMEAttrs Callee,
bool  BodyOverridesInterface = false 
) const
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 52 of file AArch64SMEAttributes.cpp.

References Callee, hasNonStreamingInterfaceAndBody(), and hasStreamingInterfaceOrBody().

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

◆ set()

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

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