LLVM 20.0.0git
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
llvm::IRAttribute< AK, BaseType, AAType > Struct Template Reference

Helper class that provides common functionality to manifest IR attributes. More...

#include "llvm/Transforms/IPO/Attributor.h"

Inheritance diagram for llvm::IRAttribute< AK, BaseType, AAType >:
Inheritance graph
[legend]

Public Member Functions

 IRAttribute (const IRPosition &IRP)
 
ChangeStatus manifest (Attributor &A) override
 See AbstractAttribute::manifest(...).
 
Attribute::AttrKind getAttrKind () const
 Return the kind that identifies the abstract attribute implementation.
 
virtual void getDeducedAttributes (Attributor &A, LLVMContext &Ctx, SmallVectorImpl< Attribute > &Attrs) const
 Return the deduced attributes in Attrs.
 

Static Public Member Functions

static bool hasTrivialInitializer ()
 Most boolean IRAttribute AAs don't do anything non-trivial in their initializers while non-boolean ones often do.
 
static bool isImpliedByUndef ()
 Return true if the IR attribute(s) associated with this AA are implied for an undef value.
 
static bool isImpliedByPoison ()
 Return true if the IR attribute(s) associated with this AA are implied for an poison value.
 
static bool isImpliedByIR (Attributor &A, const IRPosition &IRP, Attribute::AttrKind ImpliedAttributeKind=AK, bool IgnoreSubsumingPositions=false)
 

Static Public Attributes

static constexpr Attribute::AttrKind IRAttributeKind = AK
 Compile time access to the IR attribute kind.
 

Detailed Description

template<Attribute::AttrKind AK, typename BaseType, typename AAType>
struct llvm::IRAttribute< AK, BaseType, AAType >

Helper class that provides common functionality to manifest IR attributes.

Definition at line 3181 of file Attributor.h.

Constructor & Destructor Documentation

◆ IRAttribute()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
llvm::IRAttribute< AK, BaseType, AAType >::IRAttribute ( const IRPosition IRP)
inline

Definition at line 3182 of file Attributor.h.

Member Function Documentation

◆ getAttrKind()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
Attribute::AttrKind llvm::IRAttribute< AK, BaseType, AAType >::getAttrKind ( ) const
inline

Return the kind that identifies the abstract attribute implementation.

Definition at line 3224 of file Attributor.h.

Referenced by llvm::IRAttribute< AK, BaseType, AAType >::getDeducedAttributes().

◆ getDeducedAttributes()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
virtual void llvm::IRAttribute< AK, BaseType, AAType >::getDeducedAttributes ( Attributor A,
LLVMContext Ctx,
SmallVectorImpl< Attribute > &  Attrs 
) const
inlinevirtual

Return the deduced attributes in Attrs.

Definition at line 3227 of file Attributor.h.

References llvm::Attribute::get(), and llvm::IRAttribute< AK, BaseType, AAType >::getAttrKind().

Referenced by llvm::IRAttribute< AK, BaseType, AAType >::manifest().

◆ hasTrivialInitializer()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
static bool llvm::IRAttribute< AK, BaseType, AAType >::hasTrivialInitializer ( )
inlinestatic

Most boolean IRAttribute AAs don't do anything non-trivial in their initializers while non-boolean ones often do.

Subclasses can change this.

Definition at line 3187 of file Attributor.h.

References llvm::Attribute::isEnumAttrKind().

◆ isImpliedByIR()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
static bool llvm::IRAttribute< AK, BaseType, AAType >::isImpliedByIR ( Attributor A,
const IRPosition IRP,
Attribute::AttrKind  ImpliedAttributeKind = AK,
bool  IgnoreSubsumingPositions = false 
)
inlinestatic

Definition at line 3200 of file Attributor.h.

References A, and llvm::IRPosition::getAssociatedValue().

Referenced by llvm::AAWillReturn::isImpliedByIR().

◆ isImpliedByPoison()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
static bool llvm::IRAttribute< AK, BaseType, AAType >::isImpliedByPoison ( )
inlinestatic

Return true if the IR attribute(s) associated with this AA are implied for an poison value.

Definition at line 3198 of file Attributor.h.

◆ isImpliedByUndef()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
static bool llvm::IRAttribute< AK, BaseType, AAType >::isImpliedByUndef ( )
inlinestatic

Return true if the IR attribute(s) associated with this AA are implied for an undef value.

Definition at line 3194 of file Attributor.h.

◆ manifest()

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
ChangeStatus llvm::IRAttribute< AK, BaseType, AAType >::manifest ( Attributor A)
inlineoverride

See AbstractAttribute::manifest(...).

Definition at line 3213 of file Attributor.h.

References A, llvm::SmallVectorBase< Size_T >::empty(), llvm::IRAttribute< AK, BaseType, AAType >::getDeducedAttributes(), and llvm::UNCHANGED.

Member Data Documentation

◆ IRAttributeKind

template<Attribute::AttrKind AK, typename BaseType , typename AAType >
constexpr Attribute::AttrKind llvm::IRAttribute< AK, BaseType, AAType >::IRAttributeKind = AK
staticconstexpr

Compile time access to the IR attribute kind.

Definition at line 3190 of file Attributor.h.


The documentation for this struct was generated from the following file: