LLVM 23.0.0git
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 >:
[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 3240 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 3241 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 3283 of file Attributor.h.

Referenced by 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 3286 of file Attributor.h.

References A(), llvm::Attribute::get(), and getAttrKind().

Referenced by manifest().

◆ hasTrivialInitializer()

template<Attribute::AttrKind AK, typename BaseType, typename AAType>
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 3246 of file Attributor.h.

References llvm::Attribute::isEnumAttrKind().

◆ isImpliedByIR()

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

◆ isImpliedByPoison()

template<Attribute::AttrKind AK, typename BaseType, typename AAType>
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 3257 of file Attributor.h.

◆ isImpliedByUndef()

template<Attribute::AttrKind AK, typename BaseType, typename AAType>
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 3253 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 3272 of file Attributor.h.

References A(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), getDeducedAttributes(), llvm::isa(), and llvm::UNCHANGED.

Member Data Documentation

◆ IRAttributeKind

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

Compile time access to the IR attribute kind.

Definition at line 3249 of file Attributor.h.


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