LLVM  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::AbstractAttribute Struct Referenceabstract

Base struct for all "concrete attribute" deductions. More...

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

Inheritance diagram for llvm::AbstractAttribute:
Inheritance graph
[legend]
Collaboration diagram for llvm::AbstractAttribute:
Collaboration graph
[legend]

Public Types

using StateType = AbstractState
 
- Public Types inherited from llvm::IRPosition
enum  Kind : char {
  IRP_INVALID, IRP_FLOAT, IRP_RETURNED, IRP_CALL_SITE_RETURNED,
  IRP_FUNCTION, IRP_CALL_SITE, IRP_ARGUMENT, IRP_CALL_SITE_ARGUMENT
}
 The positions we distinguish in the IR. More...
 
using CallBaseContext = CallBase
 
- Public Types inherited from llvm::AADepGraphNode
using DepTy = PointerIntPair< AADepGraphNode *, 1 >
 
using iterator = mapped_iterator< TinyPtrVector< DepTy >::iterator, decltype(&DepGetVal)>
 
using aaiterator = mapped_iterator< TinyPtrVector< DepTy >::iterator, decltype(&DepGetValAA)>
 

Public Member Functions

 AbstractAttribute (const IRPosition &IRP)
 
virtual ~AbstractAttribute ()
 Virtual destructor. More...
 
virtual void initialize (Attributor &A)
 Initialize the state with the information in the Attributor A. More...
 
virtual StateTypegetState ()=0
 Return the internal abstract state for inspection. More...
 
virtual const StateTypegetState () const =0
 
const IRPositiongetIRPosition () const
 Return an IR position, see struct IRPosition. More...
 
IRPositiongetIRPosition ()
 
void print (raw_ostream &OS) const override
 Helper functions, for debug purposes only. More...
 
virtual void printWithDeps (raw_ostream &OS) const
 
void dump () const
 
virtual const std::string getAsStr () const =0
 This function should return the "summarized" assumed state as string. More...
 
virtual const std::string getName () const =0
 This function should return the name of the AbstractAttribute. More...
 
virtual const char * getIdAddr () const =0
 This function should return the address of the ID of the AbstractAttribute. More...
 
- Public Member Functions inherited from llvm::IRPosition
 IRPosition ()
 Default constructor available to create invalid positions implicitly. More...
 
bool operator== (const IRPosition &RHS) const
 
bool operator!= (const IRPosition &RHS) const
 
ValuegetAnchorValue () const
 Return the value this abstract attribute is anchored with. More...
 
FunctiongetAssociatedFunction () const
 Return the associated function, if any. More...
 
ArgumentgetAssociatedArgument () const
 Return the associated argument, if any. More...
 
bool isFnInterfaceKind () const
 Return true if the position refers to a function interface, that is the function scope, the function return, or an argument. More...
 
FunctiongetAnchorScope () const
 Return the Function surrounding the anchor value. More...
 
InstructiongetCtxI () const
 Return the context instruction, if any. More...
 
ValuegetAssociatedValue () const
 Return the value this abstract attribute is associated with. More...
 
TypegetAssociatedType () const
 Return the type this abstract attribute is associated with. More...
 
int getCalleeArgNo () const
 Return the callee argument number of the associated value if it is an argument or call site argument, otherwise a negative value. More...
 
int getCallSiteArgNo () const
 Return the call site argument number of the associated value if it is an argument or call site argument, otherwise a negative value. More...
 
unsigned getAttrIdx () const
 Return the index in the attribute list for this position. More...
 
Kind getPositionKind () const
 Return the associated position kind. More...
 
bool hasAttr (ArrayRef< Attribute::AttrKind > AKs, bool IgnoreSubsumingPositions=false, Attributor *A=nullptr) const
 TODO: Figure out if the attribute related helper functions should live here or somewhere else. More...
 
void getAttrs (ArrayRef< Attribute::AttrKind > AKs, SmallVectorImpl< Attribute > &Attrs, bool IgnoreSubsumingPositions=false, Attributor *A=nullptr) const
 Return the attributes of any kind in AKs existing in the IR at a position that will affect this one. More...
 
void removeAttrs (ArrayRef< Attribute::AttrKind > AKs) const
 Remove the attribute of kind AKs existing in the IR at this position. More...
 
bool isAnyCallSitePosition () const
 
bool isArgumentPosition () const
 Return true if the position is an argument or call site argument. More...
 
IRPosition stripCallBaseContext () const
 Return the same position without the call base context. More...
 
const CallBaseContextgetCallBaseContext () const
 Get the call base context from the position. More...
 
bool hasCallBaseContext () const
 Check if the position has any call base context. More...
 
 operator void * () const
 } More...
 
- Public Member Functions inherited from llvm::AADepGraphNode
virtual ~AADepGraphNode ()
 
aaiterator begin ()
 
aaiterator end ()
 
iterator child_begin ()
 
iterator child_end ()
 
TinyPtrVector< DepTy > & getDeps ()
 

Static Public Member Functions

static bool classof (const AADepGraphNode *DGN)
 This function is used to identify if an DGN is of type AbstractAttribute so that the dyn_cast and cast can use such information to cast an AADepGraphNode to an AbstractAttribute. More...
 
- Static Public Member Functions inherited from llvm::IRPosition
static const IRPosition value (const Value &V, const CallBaseContext *CBContext=nullptr)
 Create a position describing the value of V. More...
 
static const IRPosition function (const Function &F, const CallBaseContext *CBContext=nullptr)
 Create a position describing the function scope of F. More...
 
static const IRPosition returned (const Function &F, const CallBaseContext *CBContext=nullptr)
 Create a position describing the returned value of F. More...
 
static const IRPosition argument (const Argument &Arg, const CallBaseContext *CBContext=nullptr)
 Create a position describing the argument Arg. More...
 
static const IRPosition callsite_function (const CallBase &CB)
 Create a position describing the function scope of CB. More...
 
static const IRPosition callsite_returned (const CallBase &CB)
 Create a position describing the returned value of CB. More...
 
static const IRPosition callsite_argument (const CallBase &CB, unsigned ArgNo)
 Create a position describing the argument of CB at position ArgNo. More...
 
static const IRPosition callsite_argument (AbstractCallSite ACS, unsigned ArgNo)
 Create a position describing the argument of ACS at position ArgNo. More...
 
static const IRPosition function_scope (const IRPosition &IRP, const CallBaseContext *CBContext=nullptr)
 Create a position with function scope matching the "context" of IRP. More...
 

Protected Member Functions

ChangeStatus update (Attributor &A)
 Hook for the Attributor to trigger an update of the internal state. More...
 
virtual ChangeStatus manifest (Attributor &A)
 Hook for the Attributor to trigger the manifestation of the information represented by the abstract attribute in the LLVM-IR. More...
 
virtual void trackStatistics () const =0
 Hook to enable custom statistic tracking, called after manifest that resulted in a change if statistics are enabled. More...
 
virtual ChangeStatus updateImpl (Attributor &A)=0
 The actual update/transfer function which has to be implemented by the derived classes. More...
 
- Protected Member Functions inherited from llvm::AADepGraphNode
 operator AbstractAttribute * ()
 

Friends

struct Attributor
 } More...
 

Additional Inherited Members

- Static Public Attributes inherited from llvm::IRPosition
static const IRPosition EmptyKey
 Special DenseMap key values. More...
 
static const IRPosition TombstoneKey
 
- Static Protected Member Functions inherited from llvm::AADepGraphNode
static AADepGraphNodeDepGetVal (DepTy &DT)
 
static AbstractAttributeDepGetValAA (DepTy &DT)
 
- Protected Attributes inherited from llvm::AADepGraphNode
TinyPtrVector< DepTyDeps
 Set of dependency graph nodes which should be updated if this one is updated. More...
 

Detailed Description

Base struct for all "concrete attribute" deductions.

The abstract attribute is a minimal interface that allows the Attributor to orchestrate the abstract/fixpoint analysis. The design allows to hide away implementation choices made for the subclasses but also to structure their implementation and simplify the use of other abstract attributes in-flight.

To allow easy creation of new attributes, most methods have default implementations. The ones that do not are generally straight forward, except AbstractAttribute::updateImpl which is the location of most reasoning associated with the abstract attribute. The update is invoked by the Attributor in case the situation used to justify the current optimistic state might have changed. The Attributor determines this automatically by monitoring the Attributor::getAAFor calls made by abstract attributes.

The updateImpl method should inspect the IR and other abstract attributes in-flight to justify the best possible (=optimistic) state. The actual implementation is, similar to the underlying abstract state encoding, not exposed. In the most common case, the updateImpl will go through a list of reasons why its optimistic state is valid given the current information. If any combination of them holds and is sufficient to justify the current optimistic state, the method shall return UNCHAGED. If not, the optimistic state is adjusted to the situation and the method shall return CHANGED.

If the manifestation of the "concrete attribute" deduced by the subclass differs from the "default" behavior, which is a (set of) LLVM-IR attribute(s) for an argument, call site argument, function return value, or function, the AbstractAttribute::manifest method should be overloaded.

NOTE: If the state obtained via getState() is INVALID, thus if AbstractAttribute::getState().isValidState() returns false, no information provided by the methods of this class should be used. NOTE: The Attributor currently has certain limitations to what we can do. As a general rule of thumb, "concrete" abstract attributes should for now only perform "backward" information propagation. That means optimistic information obtained through abstract attributes should only be used at positions that precede the origin of the information with regards to the program flow. More practically, information can now be propagated from instructions to their enclosing function, but not from call sites to the called function. The mechanisms to allow both directions will be added in the future. NOTE: The mechanics of adding a new "concrete" abstract attribute are described in the file comment.

Definition at line 2629 of file Attributor.h.

Member Typedef Documentation

◆ StateType

Definition at line 2630 of file Attributor.h.

Constructor & Destructor Documentation

◆ AbstractAttribute()

llvm::AbstractAttribute::AbstractAttribute ( const IRPosition IRP)
inline

Definition at line 2632 of file Attributor.h.

◆ ~AbstractAttribute()

virtual llvm::AbstractAttribute::~AbstractAttribute ( )
inlinevirtual

Virtual destructor.

Definition at line 2635 of file Attributor.h.

Referenced by llvm::Attributor::~Attributor().

Member Function Documentation

◆ classof()

static bool llvm::AbstractAttribute::classof ( const AADepGraphNode DGN)
inlinestatic

This function is used to identify if an DGN is of type AbstractAttribute so that the dyn_cast and cast can use such information to cast an AADepGraphNode to an AbstractAttribute.

We eagerly return true here because all AADepGraphNodes except for the Synthethis Node are of type AbstractAttribute

Definition at line 2643 of file Attributor.h.

◆ dump()

void llvm::AbstractAttribute::dump ( ) const
inline

Definition at line 2667 of file Attributor.h.

References llvm::dbgs(), and print().

◆ getAsStr()

virtual const std::string llvm::AbstractAttribute::getAsStr ( ) const
pure virtual

◆ getIdAddr()

virtual const char* llvm::AbstractAttribute::getIdAddr ( ) const
pure virtual

This function should return the address of the ID of the AbstractAttribute.

Implemented in llvm::AAPointerInfo, llvm::AAFunctionReachability, llvm::AAExecutionDomain, llvm::AACallEdges, llvm::AANoUndef, llvm::AAPotentialValues, llvm::AAValueConstantRange, llvm::AAMemoryLocation, llvm::AAMemoryBehavior, llvm::AAPrivatizablePtr, llvm::AAHeapToStack, llvm::AAValueSimplify, llvm::AANoCapture, llvm::AAAlign, llvm::AADereferenceable, llvm::AAIsDead, llvm::AANoReturn, llvm::AANoFree, llvm::AANoAlias, llvm::AAReachability, llvm::AAUndefinedBehavior, llvm::AAWillReturn, llvm::AANoRecurse, llvm::AANonNull, llvm::AANoSync, llvm::AANoUnwind, llvm::AAReturnedValues, AAUniformWorkGroupSize, and AAAMDAttributes.

Referenced by AAAMDAttributes::classof(), AAUniformWorkGroupSize::classof(), llvm::AAReturnedValues::classof(), llvm::AANoUnwind::classof(), llvm::AANoSync::classof(), llvm::AANonNull::classof(), llvm::AANoRecurse::classof(), llvm::AAWillReturn::classof(), llvm::AAUndefinedBehavior::classof(), llvm::AAReachability::classof(), llvm::AANoAlias::classof(), llvm::AANoFree::classof(), llvm::AANoReturn::classof(), llvm::AAIsDead::classof(), llvm::AADereferenceable::classof(), llvm::AAAlign::classof(), llvm::AANoCapture::classof(), llvm::AAValueSimplify::classof(), llvm::AAHeapToStack::classof(), llvm::AAPrivatizablePtr::classof(), llvm::AAMemoryBehavior::classof(), llvm::AAMemoryLocation::classof(), llvm::AAValueConstantRange::classof(), llvm::AAPotentialValues::classof(), llvm::AANoUndef::classof(), llvm::AACallEdges::classof(), llvm::AAExecutionDomain::classof(), llvm::AAFunctionReachability::classof(), and llvm::AAPointerInfo::classof().

◆ getIRPosition() [1/2]

IRPosition& llvm::AbstractAttribute::getIRPosition ( )
inline

Definition at line 2661 of file Attributor.h.

◆ getIRPosition() [2/2]

const IRPosition& llvm::AbstractAttribute::getIRPosition ( ) const
inline

◆ getName()

virtual const std::string llvm::AbstractAttribute::getName ( ) const
pure virtual

◆ getState() [1/2]

virtual const StateType& llvm::AbstractAttribute::getState ( ) const
pure virtual

◆ getState() [2/2]

virtual StateType& llvm::AbstractAttribute::getState ( )
pure virtual

Return the internal abstract state for inspection.

Implemented in llvm::AAPotentialValues, AADereferenceableImpl, llvm::AAValueConstantRange, llvm::StateWrapper< AA::PointerInfo::State, AAPointerInfo >, llvm::StateWrapper< BitIntegerState< uint16_t, 7, 0 >, AbstractAttribute >, llvm::StateWrapper< DerefState, AbstractAttribute >, llvm::StateWrapper< BitIntegerState< uint32_t, 511 >, AbstractAttribute >, llvm::StateWrapper< AAAlignmentStateType, AbstractAttribute >, llvm::StateWrapper< BitIntegerState< uint8_t, 3 >, AbstractAttribute >, llvm::StateWrapper< IntegerRangeState, AbstractAttribute, uint32_t >, llvm::StateWrapper< PotentialConstantIntValuesState, AbstractAttribute >, llvm::StateWrapper< BitIntegerState< uint8_t, 3, 0 >, AbstractAttribute >, llvm::StateWrapper< ValueSimplifyStateType, AbstractAttribute, Type * >, llvm::StateWrapper< BitIntegerState< uint16_t, ALL_ARGUMENT_MASK, 0 >, AbstractAttribute >, llvm::StateWrapper< BooleanState, AbstractAttribute >, AAReturnedValuesImpl, llvm::StateWrapper< AA::PointerInfo::State, AAPointerInfo >, llvm::StateWrapper< BitIntegerState< uint16_t, 7, 0 >, AbstractAttribute >, llvm::StateWrapper< DerefState, AbstractAttribute >, llvm::StateWrapper< BitIntegerState< uint32_t, 511 >, AbstractAttribute >, llvm::StateWrapper< AAAlignmentStateType, AbstractAttribute >, llvm::StateWrapper< BitIntegerState< uint8_t, 3 >, AbstractAttribute >, llvm::StateWrapper< IntegerRangeState, AbstractAttribute, uint32_t >, llvm::StateWrapper< PotentialConstantIntValuesState, AbstractAttribute >, llvm::StateWrapper< BitIntegerState< uint8_t, 3, 0 >, AbstractAttribute >, llvm::StateWrapper< ValueSimplifyStateType, AbstractAttribute, Type * >, llvm::StateWrapper< BitIntegerState< uint16_t, ALL_ARGUMENT_MASK, 0 >, AbstractAttribute >, and llvm::StateWrapper< BooleanState, AbstractAttribute >.

Referenced by llvm::Attributor::getOrCreateAAFor(), llvm::Attributor::recordDependence(), AAPointerInfoImpl::translateAndAddCalleeState(), update(), and AANoCaptureImpl::updateImpl().

◆ initialize()

virtual void llvm::AbstractAttribute::initialize ( Attributor A)
inlinevirtual

Initialize the state with the information in the Attributor A.

This function is called by the Attributor once all abstract attributes have been identified. It can and shall be used for task like:

  • identify existing knowledge in the IR and use it for the "known state"
  • perform any work that is not going to change over time, e.g., determine a subset of the IR, or attributes in-flight, that have to be looked at in the updateImpl method.

Reimplemented in AAMemoryBehaviorCallSite, AAMemoryBehaviorCallSiteReturned, AAMemoryBehaviorCallSiteArgument, AAMemoryBehaviorArgument, AAMemoryBehaviorImpl, AAPrivatizablePtrReturned, AAPrivatizablePtrCallSiteReturned, AAPrivatizablePtrCallSiteArgument, AAPrivatizablePtrFloating, AAHeapToStackFunction, AAValueSimplifyCallSiteReturned, AAValueSimplifyFunction, AAValueSimplifyFloating, AAValueSimplifyArgument, AAValueSimplifyImpl, AANoCaptureCallSiteReturned, AANoCaptureReturned, AANoCaptureCallSiteArgument, AANoCaptureImpl, AANoReturnCallSite, AANoReturnImpl, AAAlignCallSiteReturned, AAAlignReturned, AAAlignImpl, AADereferenceableImpl, AAIsDeadCallSite, AAIsDeadFunction, AAIsDeadCallSiteReturned, AAIsDeadCallSiteArgument, AAIsDeadArgument, AAIsDeadFloating, AANoAliasCallSiteReturned, AANoAliasReturned, AANoAliasCallSiteArgument, AANoAliasArgument, AANoAliasFloating, AAWillReturnCallSite, AAWillReturnFunction, AAWillReturnImpl, llvm::IRAttribute< Attribute::NonNull, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::ReadNone, StateWrapper< BitIntegerState< uint32_t, 511 >, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoSync, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoRecurse, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::Alignment, StateWrapper< AAAlignmentStateType, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoFree, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::Dereferenceable, StateWrapper< DerefState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoReturn, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::ReadNone, StateWrapper< BitIntegerState< uint8_t, 3 >, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoUndef, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoCapture, StateWrapper< BitIntegerState< uint16_t, 7, 0 >, AbstractAttribute > >, llvm::IRAttribute< Attribute::WillReturn, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoAlias, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoUnwind, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::Returned, AbstractAttribute >, AANoRecurseCallSite, AANoRecurseFunction, AANonNullImpl, AANoFreeReturned, AANoFreeCallSite, AANoSyncCallSite, AAReturnedValuesCallSite, AAReturnedValuesImpl, AANoUnwindCallSite, AAPointerInfoArgument, AAPointerInfoFloating, AAPointerInfoImpl, AAAMDAttributesFunction, and AAUniformWorkGroupSizeFunction.

Definition at line 2653 of file Attributor.h.

Referenced by AAPointerInfoImpl::initialize(), and AAHeapToStackFunction::initialize().

◆ manifest()

virtual ChangeStatus llvm::AbstractAttribute::manifest ( Attributor A)
inlineprotectedvirtual

Hook for the Attributor to trigger the manifestation of the information represented by the abstract attribute in the LLVM-IR.

\Return CHANGED if the IR was altered, otherwise UNCHANGED.

Reimplemented in AAMemoryBehaviorFunction, AAMemoryBehaviorCallSiteReturned, AAMemoryBehaviorArgument, AAMemoryBehaviorImpl, AAPrivatizablePtrArgument, AAHeapToStackFunction, AAValueSimplifyCallSiteArgument, AAValueSimplifyReturned, AAValueSimplifyImpl, AAAlignCallSiteArgument, AAAlignArgument, AAAlignImpl, AADereferenceableImpl, AAIsDeadFunction, AAIsDeadReturned, AAIsDeadCallSiteArgument, AAIsDeadArgument, AAIsDeadFloating, AAUndefinedBehaviorImpl, llvm::IRAttribute< Attribute::NonNull, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::ReadNone, StateWrapper< BitIntegerState< uint32_t, 511 >, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoSync, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoRecurse, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::Alignment, StateWrapper< AAAlignmentStateType, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoFree, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::Dereferenceable, StateWrapper< DerefState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoReturn, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::ReadNone, StateWrapper< BitIntegerState< uint8_t, 3 >, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoUndef, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoCapture, StateWrapper< BitIntegerState< uint16_t, 7, 0 >, AbstractAttribute > >, llvm::IRAttribute< Attribute::WillReturn, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoAlias, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::NoUnwind, StateWrapper< BooleanState, AbstractAttribute > >, llvm::IRAttribute< Attribute::Returned, AbstractAttribute >, AANoFreeCallSiteReturned, AAReturnedValuesImpl, AAPointerInfoImpl, AAAMDAttributesFunction, and AAUniformWorkGroupSizeFunction.

Definition at line 2695 of file Attributor.h.

References llvm::UNCHANGED.

Referenced by AAPointerInfoImpl::manifest(), AAValueSimplifyImpl::manifest(), AAValueSimplifyReturned::manifest(), and AAValueSimplifyCallSiteArgument::manifest().

◆ print()

void AbstractAttribute::print ( raw_ostream OS) const
overridevirtual

Helper functions, for debug purposes only.

{

Reimplemented from llvm::AADepGraphNode.

Definition at line 2743 of file Attributor.cpp.

References getAsStr(), llvm::IRPosition::getCtxI(), getIRPosition(), getName(), and I.

Referenced by dump(), AAPrivatizablePtrArgument::identifyPrivatizableType(), llvm::operator<<(), and printWithDeps().

◆ printWithDeps()

void AbstractAttribute::printWithDeps ( raw_ostream OS) const
virtual

Definition at line 2759 of file Attributor.cpp.

References llvm::AADepGraphNode::Deps, and print().

◆ trackStatistics()

virtual void llvm::AbstractAttribute::trackStatistics ( ) const
protectedpure virtual

Hook to enable custom statistic tracking, called after manifest that resulted in a change if statistics are enabled.

We require subclasses to provide an implementation so we remember to add statistics for them.

Implemented in AAMemoryBehaviorCallSite, AAMemoryBehaviorFunction, AAMemoryBehaviorCallSiteReturned, AAMemoryBehaviorCallSiteArgument, AAMemoryBehaviorArgument, AAMemoryBehaviorFloating, AAPrivatizablePtrReturned, AAPrivatizablePtrCallSiteReturned, AAPrivatizablePtrCallSiteArgument, AAPrivatizablePtrFloating, AAPrivatizablePtrArgument, AAHeapToStackFunction, AAValueSimplifyCallSiteArgument, AAValueSimplifyCallSiteReturned, AAValueSimplifyCallSite, AAValueSimplifyFunction, AAValueSimplifyFloating, AAValueSimplifyReturned, AAValueSimplifyArgument, AAValueSimplifyImpl, AANoCaptureCallSiteReturned, AANoCaptureReturned, AANoCaptureFloating, AANoCaptureCallSiteArgument, AANoCaptureArgument, AANoReturnCallSite, AANoReturnFunction, AAAlignCallSiteReturned, AAAlignCallSiteArgument, AAAlignArgument, AAAlignReturned, AAAlignFloating, AADereferenceableCallSiteReturned, AADereferenceableCallSiteArgument, AADereferenceableArgument, AADereferenceableReturned, AADereferenceableFloating, AAIsDeadCallSite, AAIsDeadFunction, AAIsDeadReturned, AAIsDeadCallSiteReturned, AAIsDeadCallSiteArgument, AAIsDeadArgument, AAIsDeadFloating, AANoAliasCallSiteReturned, AANoAliasReturned, AANoAliasCallSiteArgument, AANoAliasArgument, AANoAliasFloating, AAReachabilityFunction, AAWillReturnCallSite, AAWillReturnFunction, AAUndefinedBehaviorFunction, AANoRecurseCallSite, AANoRecurseFunction, AANonNullCallSiteReturned, AANonNullCallSiteArgument, AANonNullArgument, AANonNullFloating, AANoFreeCallSiteReturned, AANoFreeReturned, AANoFreeCallSiteArgument, AANoFreeArgument, AANoFreeFloating, AANoFreeCallSite, AANoFreeFunction, AANoSyncCallSite, AANoSyncFunction, AAReturnedValuesCallSite, AAReturnedValuesFunction, AANoUnwindCallSite, AANoUnwindFunction, AAPointerInfoCallSiteReturned, AAPointerInfoCallSiteArgument, AAPointerInfoArgument, AAPointerInfoReturned, AAPointerInfoFloating, AAAMDAttributesFunction, and AAUniformWorkGroupSizeFunction.

◆ update()

ChangeStatus AbstractAttribute::update ( Attributor A)
protected

Hook for the Attributor to trigger an update of the internal state.

If this attribute is already fixed, this method will return UNCHANGED, otherwise it delegates to AbstractAttribute::updateImpl.

\Return CHANGED if the internal state changed, otherwise UNCHANGED.

Definition at line 469 of file Attributor.cpp.

References llvm::dbgs(), getState(), LLVM_DEBUG, llvm::UNCHANGED, and updateImpl().

◆ updateImpl()

virtual ChangeStatus llvm::AbstractAttribute::updateImpl ( Attributor A)
protectedpure virtual

The actual update/transfer function which has to be implemented by the derived classes.

If it is called, the environment has changed and we have to determine if the current information is still valid or adjust it otherwise.

\Return CHANGED if the internal state changed, otherwise UNCHANGED.

Implemented in AAMemoryBehaviorCallSite, AAMemoryBehaviorFunction, AAMemoryBehaviorCallSiteArgument, AAMemoryBehaviorFloating, AAPrivatizablePtrCallSiteArgument, AAPrivatizablePtrFloating, AAPrivatizablePtrArgument, AAHeapToStackFunction, AAValueSimplifyCallSiteReturned, AAValueSimplifyFunction, AAValueSimplifyFloating, AAValueSimplifyReturned, AAValueSimplifyArgument, AANoCaptureReturned, AANoCaptureCallSiteArgument, AANoCaptureImpl, AANoReturnCallSite, AANoReturnImpl, AAAlignCallSiteArgument, AAAlignFloating, AADereferenceableFloating, AAIsDeadCallSite, AAIsDeadFunction, AAIsDeadReturned, AAIsDeadCallSiteReturned, AAIsDeadCallSiteArgument, AAIsDeadFloating, AANoAliasCallSiteReturned, AANoAliasReturned, AANoAliasCallSiteArgument, AANoAliasArgument, AANoAliasFloating, AAReachabilityImpl, AAWillReturnCallSite, AAWillReturnImpl, AAUndefinedBehaviorImpl, AANoRecurseCallSite, AANoRecurseFunction, AANonNullFloating, AANoFreeReturned, AANoFreeCallSiteArgument, AANoFreeFloating, AANoFreeCallSite, AANoFreeImpl, AANoSyncCallSite, AANoSyncImpl, AAReturnedValuesCallSite, AAReturnedValuesImpl, AANoUnwindCallSite, AANoUnwindImpl, AAPointerInfoCallSiteArgument, AAPointerInfoReturned, AAPointerInfoFloating, AAAMDAttributesFunction, and AAUniformWorkGroupSizeFunction.

Referenced by update().

Friends And Related Function Documentation

◆ Attributor

friend struct Attributor
friend

}

Allow the Attributor access to the protected methods.

Definition at line 2680 of file Attributor.h.


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