LLVM  10.0.0
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
llvm::IRPosition Struct Reference

} More...

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

Inheritance diagram for llvm::IRPosition:
[legend]
Collaboration diagram for llvm::IRPosition:
[legend]

Public Types

enum  Kind : int {
  IRP_INVALID = -6, IRP_FLOAT = -5, IRP_RETURNED = -4, IRP_CALL_SITE_RETURNED = -3,
  IRP_FUNCTION = -2, IRP_CALL_SITE = -1, IRP_ARGUMENT = 0, IRP_CALL_SITE_ARGUMENT = 1
}
 The positions we distinguish in the IR. More...
 

Public Member Functions

virtual ~IRPosition ()
 
 IRPosition ()
 Default constructor available to create invalid positions implicitly. More...
 
bool operator== (const IRPosition &RHS) const
 
bool operator!= (const IRPosition &RHS) const
 
Value & getAnchorValue () const
 Return the value this abstract attribute is anchored with. More...
 
Function * getAssociatedFunction () const
 Return the associated function, if any. More...
 
Argument * getAssociatedArgument () 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...
 
Function * getAnchorScope () const
 Return the Function surrounding the anchor value. More...
 
Instruction * getCtxI () const
 Return the context instruction, if any. More...
 
Value & getAssociatedValue () const
 Return the value this abstract attribute is associated with. More...
 
int getArgNo () const
 Return the 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) 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) const
 Return the attributes of any kind in AKs existing in the IR at a position that will affect this one. More...
 
Attribute getAttr (Attribute::AttrKind AK) const
 Return the attribute of kind AK existing in the IR at this position. 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
 

Static Public Member Functions

static const IRPosition value (const Value &V)
 Create a position describing the value of V. More...
 
static const IRPosition function (const Function &F)
 Create a position describing the function scope of F. More...
 
static const IRPosition returned (const Function &F)
 Create a position describing the returned value of F. More...
 
static const IRPosition argument (const Argument &Arg)
 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_function (ImmutableCallSite ICS)
 Create a position describing the function scope of ICS. More...
 
static const IRPosition callsite_returned (ImmutableCallSite ICS)
 Create a position describing the returned value of ICS. More...
 
static const IRPosition callsite_argument (ImmutableCallSite ICS, unsigned ArgNo)
 Create a position describing the argument of ICS 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)
 Create a position with function scope matching the "context" of IRP. More...
 

Static Public Attributes

static const IRPosition EmptyKey
 Special DenseMap key values. More...
 
static const IRPosition TombstoneKey
 

Protected Attributes

Value * AnchorVal
 The value this position is anchored at. More...
 
int KindOrArgNo
 The argument number, if non-negative, or the position "kind". More...
 

Detailed Description

}

Helper to describe and deal with positions in the LLVM-IR.

A position in the IR is described by an anchor value and an "offset" that could be the argument number, for call sites and arguments, or an indicator of the "position kind". The kinds, specified in the Kind enum below, include the locations in the attribute list, i.a., function scope and return value, as well as a distinction between call sites and functions. Finally, there are floating values that do not have a corresponding attribute list position.

Definition at line 145 of file Attributor.h.

Member Enumeration Documentation

◆ Kind

The positions we distinguish in the IR.

The values are chosen such that the KindOrArgNo member has a value >= 1 if it is an argument or call site argument while a value < 1 indicates the respective kind of that value.

Enumerator
IRP_INVALID 

An invalid position.

IRP_FLOAT 

A position that is not associated with a spot suitable for attributes.

This could be any value or instruction.

IRP_RETURNED 

An attribute for the function return value.

IRP_CALL_SITE_RETURNED 

An attribute for a call site return value.

IRP_FUNCTION 

An attribute for a function (scope).

IRP_CALL_SITE 

An attribute for a call site (function scope).

IRP_ARGUMENT 

An attribute for a function argument.

IRP_CALL_SITE_ARGUMENT 

An attribute for a call site argument.

Definition at line 153 of file Attributor.h.

Constructor & Destructor Documentation

◆ ~IRPosition()

virtual llvm::IRPosition::~IRPosition ( )
inlinevirtual

Definition at line 146 of file Attributor.h.

◆ IRPosition()

llvm::IRPosition::IRPosition ( )
inline

Default constructor available to create invalid positions implicitly.

All other positions need to be created explicitly through the appropriate static member function.

Definition at line 168 of file Attributor.h.

References llvm::verify().

Member Function Documentation

◆ argument()

static const IRPosition llvm::IRPosition::argument ( const Argument &  Arg)
inlinestatic

Create a position describing the argument Arg.

Definition at line 190 of file Attributor.h.

References llvm::Argument::getArgNo().

Referenced by getAttrs(), llvm::Attributor::identifyDefaultAbstractAttributes(), llvm::SubsumingPositionIterator::SubsumingPositionIterator(), and value().

◆ callsite_argument() [1/3]

static const IRPosition llvm::IRPosition::callsite_argument ( const CallBase &  CB,
unsigned  ArgNo 
)
inlinestatic

Create a position describing the argument of CB at position ArgNo.

Definition at line 205 of file Attributor.h.

Referenced by callsite_argument(), getAttrs(), and llvm::Attributor::identifyDefaultAbstractAttributes().

◆ callsite_argument() [2/3]

static const IRPosition llvm::IRPosition::callsite_argument ( ImmutableCallSite  ICS,
unsigned  ArgNo 
)
inlinestatic

Create a position describing the argument of ICS at position ArgNo.

Definition at line 221 of file Attributor.h.

References callsite_argument(), and llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getInstruction().

◆ callsite_argument() [3/3]

static const IRPosition llvm::IRPosition::callsite_argument ( AbstractCallSite  ACS,
unsigned  ArgNo 
)
inlinestatic

Create a position describing the argument of ACS at position ArgNo.

Definition at line 228 of file Attributor.h.

References callsite_argument(), llvm::AbstractCallSite::getCallArgOperandNo(), and llvm::AbstractCallSite::getInstruction().

◆ callsite_function() [1/2]

static const IRPosition llvm::IRPosition::callsite_function ( const CallBase &  CB)
inlinestatic

Create a position describing the function scope of CB.

Definition at line 195 of file Attributor.h.

Referenced by callsite_function(), function_scope(), getAttrs(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().

◆ callsite_function() [2/2]

static const IRPosition llvm::IRPosition::callsite_function ( ImmutableCallSite  ICS)
inlinestatic

Create a position describing the function scope of ICS.

Definition at line 211 of file Attributor.h.

References callsite_function(), and llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getInstruction().

◆ callsite_returned() [1/2]

static const IRPosition llvm::IRPosition::callsite_returned ( const CallBase &  CB)
inlinestatic

Create a position describing the returned value of CB.

Definition at line 200 of file Attributor.h.

Referenced by callsite_returned(), getAttrs(), llvm::Attributor::identifyDefaultAbstractAttributes(), and value().

◆ callsite_returned() [2/2]

static const IRPosition llvm::IRPosition::callsite_returned ( ImmutableCallSite  ICS)
inlinestatic

Create a position describing the returned value of ICS.

Definition at line 216 of file Attributor.h.

References callsite_returned(), and llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getInstruction().

◆ function()

static const IRPosition llvm::IRPosition::function ( const Function &  F)
inlinestatic

◆ function_scope()

static const IRPosition llvm::IRPosition::function_scope ( const IRPosition &  IRP)
inlinestatic

Create a position with function scope matching the "context" of IRP.

If IRP is a call site (see isAnyCallSitePosition()) then the result will be a call site position, otherwise the function position of the associated function.

Definition at line 241 of file Attributor.h.

References assert(), callsite_function(), function(), getAnchorValue(), getAssociatedFunction(), and isAnyCallSitePosition().

Referenced by getAttrs().

◆ getAnchorScope()

Function* llvm::IRPosition::getAnchorScope ( ) const
inline

◆ getAnchorValue()

Value& llvm::IRPosition::getAnchorValue ( ) const
inline

Return the value this abstract attribute is anchored with.

The anchor value might not be the associated value if the latter is not sufficient to determine where arguments will be manifested. This is, so far, only the case for call site arguments as the value is not sufficient to pinpoint them. Instead, we can use the call site as an anchor.

Definition at line 261 of file Attributor.h.

References assert().

Referenced by function_scope(), getAssociatedArgument(), getAttrs(), llvm::DenseMapInfo< IRPosition >::getHashValue(), llvm::IRAttributeManifest::manifestAttrs(), llvm::operator<<(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().

◆ getArgNo()

int llvm::IRPosition::getArgNo ( ) const
inline

Return the argument number of the associated value if it is an argument or call site argument, otherwise a negative value.

Definition at line 337 of file Attributor.h.

Referenced by getAssociatedArgument(), getAttrs(), llvm::DenseMapInfo< IRPosition >::getHashValue(), llvm::operator<<(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().

◆ getAssociatedArgument()

Argument * IRPosition::getAssociatedArgument ( ) const

◆ getAssociatedFunction()

Function* llvm::IRPosition::getAssociatedFunction ( ) const
inline

◆ getAssociatedValue()

Value& llvm::IRPosition::getAssociatedValue ( ) const
inline

◆ getAttr()

Attribute llvm::IRPosition::getAttr ( Attribute::AttrKind  AK) const
inline

Return the attribute of kind AK existing in the IR at this position.

Definition at line 400 of file Attributor.h.

References llvm::Attribute, llvm::AttributeList::getAttribute(), llvm::AttributeList::getAttributes(), and llvm::AttributeList::hasAttribute().

◆ getAttrIdx()

unsigned llvm::IRPosition::getAttrIdx ( ) const
inline

◆ getAttrs()

void IRPosition::getAttrs ( ArrayRef< Attribute::AttrKind >  AKs,
SmallVectorImpl< Attribute > &  Attrs,
bool  IgnoreSubsumingPositions = false 
) const

Return the attributes of any kind in AKs existing in the IR at a position that will affect this one.

While each position can only have a single attribute of any kind in AKs, there are "subsuming" positions that could have an attribute as well. This method returns all attributes found in Attrs.

Parameters
IgnoreSubsumingPositionsFlag to determine if subsuming positions, e.g., the function position if this is an argument position, should be ignored.

Definition at line 551 of file Attributor.cpp.

References llvm::abs(), llvm::BitIntegerState< base_ty, BestState, WorstState >::addKnownBits(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::support::aligned, llvm::all_of(), AnchorVal, Arg, llvm::Function::arg_size(), llvm::Function::args(), argument(), assert(), llvm::AMDGPU::HSAMD::Kernel::Key::Attrs, llvm::MapVector< KeyT, ValueT, MapType, VectorType >::begin(), llvm::MustBeExecutedContextExplorer::begin(), BUILD_STAT_NAME, C, llvm::MCID::Call, callsite_argument(), callsite_function(), callsite_returned(), llvm::canSimplifyInvokeNoUnwind(), llvm::SwitchInst::cases(), llvm::CHANGED, llvm::Attributor::changeToUnreachableAfterManifest(), llvm::Attributor::changeUseAfterManifest(), llvm::Attributor::changeValueAfterManifest(), llvm::Attributor::checkForAllCallLikeInstructions(), llvm::Attributor::checkForAllCallSites(), llvm::Attributor::checkForAllInstructions(), llvm::Attributor::checkForAllReadWriteInstructions(), llvm::Attributor::checkForAllReturnedValues(), llvm::Attributor::checkForAllUses(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::clear(), llvm::SmallVectorImpl< T >::clear(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::CallInst::Create(), llvm::BranchInst::Create(), llvm::dbgs(), llvm::DefaultMaxUsesToExplore, llvm::Attributor::deleteAfterManifest(), llvm::depth_first(), llvm::DerefState::DerefBytesState, llvm::Function::doesNotThrow(), llvm::SIInstrFlags::DS, llvm::dyn_cast(), llvm::numbers::e, llvm::SmallVectorImpl< T >::emplace_back(), llvm::SmallVectorBase::empty(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::end(), llvm::MustBeExecutedContextExplorer::end(), F(), llvm::MustBeExecutedContextExplorer::findInContextOf(), llvm::BasicBlock::front(), function(), function_scope(), G, gcd(), GEP, llvm::Attribute::get(), llvm::ConstantInt::get(), llvm::Use::get(), llvm::UndefValue::get(), llvm::Attributor::getAAFor(), llvm::InformationCache::getAAResultsForFunction(), llvm::InformationCache::getAnalysisResultForFunction(), getAnchorScope(), getAnchorValue(), getArgNo(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getArgOperand(), llvm::CallBase::getArgOperandNo(), llvm::CallBase::getArgOperandUse(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getArgumentNo(), getAssociatedArgument(), getAssociatedFunction(), getAssociatedValue(), llvm::IntegerStateBase< base_ty, BestState, WorstState >::getAssumed(), llvm::AADereferenceable::getAssumedDereferenceableBytes(), getAttrs(), getBasePointerOfAccessPointerOperand(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getCalledFunction(), llvm::BranchInst::getCondition(), llvm::SwitchInst::getCondition(), llvm::Function::getContext(), llvm::Value::getContext(), getCtxI(), llvm::Attributor::getDataLayout(), llvm::Intrinsic::getDeclaration(), llvm::SwitchInst::getDefaultDest(), llvm::InformationCache::getDL(), llvm::Function::getEntryBlock(), llvm::Instruction::getFunction(), llvm::DataLayout::getIndexSizeInBits(), llvm::Attributor::getInfoCache(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getInstruction(), llvm::Type::getInt1Ty(), llvm::Type::getInt8Ty(), llvm::Attribute::getKindAsEnum(), llvm::InformationCache::getMustBeExecutedContextExplorer(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::InvokeInst::getNormalDest(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getNumArgOperands(), llvm::Instruction::getNumSuccessors(), llvm::BranchInst::getNumSuccessors(), llvm::Value::getNumUses(), llvm::Instruction::getOpcode(), llvm::InformationCache::getOpcodeInstMapForFunction(), llvm::User::getOperand(), llvm::User::getOperandUse(), llvm::Argument::getParent(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::Type::getPointerAddressSpace(), llvm::Value::getPointerAlignment(), llvm::GetPointerBaseWithConstantOffset(), llvm::Value::getPointerDereferenceableBytes(), llvm::Type::getPointerElementType(), llvm::Attributor::getPointerOperand(), llvm::getPointerOperand(), getPositionKind(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getPrevNode(), llvm::Function::getReturnType(), llvm::ReturnInst::getReturnValue(), llvm::InformationCache::getSccSize(), llvm::APInt::getSExtValue(), llvm::AbstractAttribute::getState(), llvm::Instruction::getSuccessor(), llvm::BranchInst::getSuccessor(), llvm::InformationCache::getTargetLibraryInfoForFunction(), llvm::ConstantExpr::getTruncOrBitCast(), getType(), llvm::Value::getType(), llvm::DataLayout::getTypeStoreSize(), llvm::InvokeInst::getUnwindDest(), llvm::Use::getUser(), llvm::Optional< T >::getValue(), llvm::Attribute::getWithAlignment(), llvm::Attribute::getWithDereferenceableBytes(), llvm::Attribute::getWithDereferenceableOrNullBytes(), llvm::ConstantInt::getZExtValue(), llvm::greatestCommonDivisor(), hasAttr(), llvm::Argument::hasByValAttr(), llvm::GlobalValue::hasExactDefinition(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::hasFnAttr(), llvm::GlobalValue::hasLocalLinkage(), llvm::Function::hasParamAttribute(), llvm::Function::hasPersonalityFn(), llvm::Optional< T >::hasValue(), I, llvm::AbstractState::indicatePessimisticFixpoint(), llvm::IntegerStateBase< base_ty, BestState, WorstState >::indicatePessimisticFixpoint(), initialize(), llvm::IRAttribute< Attribute::WillReturn, StateWrapper< BooleanState, AbstractAttribute > >::initialize(), llvm::IRAttribute< AK, Base >::initialize(), llvm::IRAttribute< Attribute::NoReturn, StateWrapper< BooleanState, AbstractAttribute > >::initialize(), llvm::IRAttribute< Attribute::NonNull, StateWrapper< BooleanState, AbstractAttribute > >::initialize(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), IRP_ARGUMENT, IRP_CALL_SITE, IRP_CALL_SITE_RETURNED, IRP_FLOAT, IRP_FUNCTION, IRP_INVALID, IRP_RETURNED, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::isArgOperand(), llvm::CallBase::isArgOperand(), llvm::AAIsDead::isAssumedDead(), llvm::AANoCapture::isAssumedNoCapture(), llvm::AANoCapture::isAssumedNoCaptureMaybeReturned(), llvm::AANoFree::isAssumedNoFree(), llvm::AANoRecurse::isAssumedNoRecurse(), llvm::AANoReturn::isAssumedNoReturn(), llvm::AANoUnwind::isAssumedNoUnwind(), llvm::AbstractState::isAtFixpoint(), llvm::Instruction::isAtomic(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::isBundleOperand(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::isCallee(), llvm::CallBase::isCallee(), llvm::isCallocLikeFn(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::isConvergent(), IsDead, llvm::GlobalValue::isDeclaration(), llvm::CaptureTracker::isDereferenceableOrNull(), isFnInterfaceKind(), llvm::isFreeCall(), llvm::isKnownNonZero(), llvm::AANoReturn::isKnownNoReturn(), llvm::Instruction::isLifetimeStartOrEnd(), llvm::isMallocLikeFn(), llvm::CallBase::isMustTailCall(), llvm::Type::isPointerTy(), llvm::Instruction::isTerminator(), llvm::AbstractState::isValidState(), llvm::Type::isVoidTy(), isVolatile(), KindOrArgNo, LLVM_DEBUG, llvm_unreachable, llvm::SPII::Load, llvm::make_range(), llvm::IRAttribute< AK, Base >::manifest(), llvm::IRAttribute< Attribute::Dereferenceable, StateWrapper< DerefState, AbstractAttribute > >::manifest(), llvm::IRAttribute< Attribute::Alignment, StateWrapper< AAAlignmentStateType, AbstractAttribute > >::manifest(), llvm::AbstractAttribute::manifest(), ManifestInternal, llvm::Attributor::markLiveInternalFunction(), llvm::max(), MaxHeapToStackSize, llvm::Instruction::mayReadFromMemory(), llvm::Instruction::mayReadOrWriteMemory(), llvm::Instruction::mayWriteToMemory(), llvm::Monotonic, llvm::AANoCapture::NO_CAPTURE, llvm::AANoCapture::NO_CAPTURE_MAYBE_RETURNED, llvm::NoAlias, llvm::None, llvm::AANoCapture::NOT_CAPTURED_IN_INT, llvm::AANoCapture::NOT_CAPTURED_IN_MEM, llvm::AANoCapture::NOT_CAPTURED_IN_RET, llvm::NullPointerIsDefined(), llvm::RISCVFenceField::O, llvm::Function::onlyReadsMemory(), llvm::OPTIONAL, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::paramHasAttr(), llvm::PointerMayBeCaptured(), llvm::PowerOf2Floor(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::Attributor::registerFunctionSignatureRewrite(), llvm::Attributor::registerInvokeWithDeadSuccessor(), llvm::BitIntegerState< base_ty, BestState, WorstState >::removeAssumedBits(), removeAttrs(), llvm::Function::removeFnAttr(), replaceAllInstructionUsesWith(), llvm::MipsISD::Ret, returned(), SI, llvm::SyncScope::SingleThread, Size, llvm::SmallVectorBase::size(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::size(), llvm::Function::size(), STATS_DECL, STATS_DECLTRACK, STATS_DECLTRACK_ARG_ATTR, STATS_DECLTRACK_CS_ATTR, STATS_DECLTRACK_CSARG_ATTR, STATS_DECLTRACK_CSRET_ATTR, STATS_DECLTRACK_FLOATING_ATTR, STATS_DECLTRACK_FN_ATTR, STATS_DECLTRACK_FNRET_ATTR, llvm::SPII::Store, llvm::Value::stripAndAccumulateInBoundsConstantOffsets(), Success, llvm::successors(), llvm::T, llvm::to_string(), llvm::UNCHANGED, llvm::Unordered, llvm::Value::use_empty(), llvm::Value::user_empty(), llvm::Value::uses(), value(), and llvm::wouldInstructionBeTriviallyDead().

Referenced by getAttrs().

◆ getCtxI()

Instruction* llvm::IRPosition::getCtxI ( ) const
inline

◆ getPositionKind()

Kind llvm::IRPosition::getPositionKind ( ) const
inline

◆ hasAttr()

bool IRPosition::hasAttr ( ArrayRef< Attribute::AttrKind >  AKs,
bool  IgnoreSubsumingPositions = false 
) const

TODO: Figure out if the attribute related helper functions should live here or somewhere else.

Return true if any kind in AKs existing in the IR at a position that will affect this one. See also getAttrs(...).

Parameters
IgnoreSubsumingPositionsFlag to determine if subsuming positions, e.g., the function position if this is an argument position, should be ignored.

Definition at line 536 of file Attributor.cpp.

Referenced by getAttrs().

◆ isAnyCallSitePosition()

bool llvm::IRPosition::isAnyCallSitePosition ( ) const
inline

Definition at line 437 of file Attributor.h.

References IRP_CALL_SITE, IRP_CALL_SITE_ARGUMENT, and IRP_CALL_SITE_RETURNED.

Referenced by function_scope().

◆ isFnInterfaceKind()

bool llvm::IRPosition::isFnInterfaceKind ( ) const
inline

Return true if the position refers to a function interface, that is the function scope, the function return, or an argument.

Definition at line 288 of file Attributor.h.

References IRP_ARGUMENT, IRP_FUNCTION, and IRP_RETURNED.

Referenced by getAttrs(), and llvm::IRAttribute< Attribute::Returned, AbstractAttribute >::initialize().

◆ operator!=()

bool llvm::IRPosition::operator!= ( const IRPosition &  RHS) const
inline

Definition at line 253 of file Attributor.h.

◆ operator==()

bool llvm::IRPosition::operator== ( const IRPosition &  RHS) const
inline

Definition at line 250 of file Attributor.h.

References AnchorVal, and KindOrArgNo.

◆ removeAttrs()

void llvm::IRPosition::removeAttrs ( ArrayRef< Attribute::AttrKind >  AKs) const
inline

◆ returned()

static const IRPosition llvm::IRPosition::returned ( const Function &  F)
inlinestatic

Create a position describing the returned value of F.

Definition at line 185 of file Attributor.h.

Referenced by getAttrs(), llvm::Attributor::identifyDefaultAbstractAttributes(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().

◆ value()

static const IRPosition llvm::IRPosition::value ( const Value &  V)
inlinestatic

Member Data Documentation

◆ AnchorVal

Value* llvm::IRPosition::AnchorVal
protected

The value this position is anchored at.

Definition at line 471 of file Attributor.h.

Referenced by getAttrs(), and operator==().

◆ EmptyKey

const IRPosition IRPosition::EmptyKey
static

Special DenseMap key values.

{

Definition at line 451 of file Attributor.h.

Referenced by llvm::DenseMapInfo< IRPosition >::getEmptyKey(), and llvm::IRAttributeManifest::manifestAttrs().

◆ KindOrArgNo

int llvm::IRPosition::KindOrArgNo
protected

The argument number, if non-negative, or the position "kind".

Definition at line 474 of file Attributor.h.

Referenced by getAttrs(), and operator==().

◆ TombstoneKey

const IRPosition IRPosition::TombstoneKey
static

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