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

} More...

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

Inheritance diagram for llvm::IRPosition:
Inheritance graph
[legend]
Collaboration diagram for llvm::IRPosition:
Collaboration graph
[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
 
ValuegetAnchorValue ()
 Return the value this abstract attribute is anchored with. More...
 
const ValuegetAnchorValue () const
 
FunctiongetAssociatedFunction ()
 } More...
 
const FunctiongetAssociatedFunction () const
 
ArgumentgetAssociatedArgument ()
 } More...
 
const ArgumentgetAssociatedArgument () const
 
bool isFnInterfaceKind () const
 } More...
 
FunctiongetAnchorScope ()
 Return the Function surrounding the anchor value. More...
 
const FunctiongetAnchorScope () const
 
InstructiongetCtxI ()
 } More...
 
const InstructiongetCtxI () const
 
ValuegetAssociatedValue ()
 } More...
 
const ValuegetAssociatedValue () const
 
int getArgNo () const
 } 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) 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)
 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
 

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 138 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 146 of file Attributor.h.

Constructor & Destructor Documentation

◆ ~IRPosition()

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

Definition at line 139 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 161 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 183 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 198 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 214 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 221 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 188 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 204 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 193 of file Attributor.h.

Referenced by callsite_returned(), 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 209 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 234 of file Attributor.h.

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

Referenced by getAttrs().

◆ getAnchorScope() [1/2]

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

◆ getAnchorScope() [2/2]

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

Definition at line 333 of file Attributor.h.

◆ getAnchorValue() [1/2]

Value& llvm::IRPosition::getAnchorValue ( )
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 256 of file Attributor.h.

References assert().

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

◆ getAnchorValue() [2/2]

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

Definition at line 261 of file Attributor.h.

◆ 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 376 of file Attributor.h.

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

◆ getAssociatedArgument() [1/2]

Argument* llvm::IRPosition::getAssociatedArgument ( )
inline

}

Return the associated argument, if any.

{

Definition at line 291 of file Attributor.h.

References Arg, llvm::Function::arg_begin(), and llvm::Function::arg_size().

Referenced by getAttrs().

◆ getAssociatedArgument() [2/2]

const Argument* llvm::IRPosition::getAssociatedArgument ( ) const
inline

Definition at line 302 of file Attributor.h.

◆ getAssociatedFunction() [1/2]

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

◆ getAssociatedFunction() [2/2]

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

Definition at line 283 of file Attributor.h.

◆ getAssociatedValue() [1/2]

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

}

Return the value this abstract attribute is associated with.

{

Definition at line 361 of file Attributor.h.

References assert().

Referenced by genericValueTraversal(), getAttrs(), llvm::operator<<(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().

◆ getAssociatedValue() [2/2]

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

Definition at line 369 of file Attributor.h.

◆ 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 435 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 
) 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.

Definition at line 459 of file Attributor.cpp.

References llvm::IntegerState::addKnownBits(), llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::support::aligned, llvm::all_of(), 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(), llvm::canSimplifyInvokeNoUnwind(), llvm::CHANGED, llvm::changeToUnreachable(), llvm::Attributor::checkForAllCallLikeInstructions(), llvm::Attributor::checkForAllCallSites(), llvm::Attributor::checkForAllInstructions(), llvm::Attributor::checkForAllReadWriteInstructions(), llvm::Attributor::checkForAllReturnedValues(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::clear(), llvm::MustBeExecutedIterator::count(), llvm::SmallPtrSetImpl< PtrType >::count(), llvm::CallInst::Create(), llvm::BranchInst::Create(), llvm::createCallMatchingInvoke(), 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::BasicBlock::front(), function(), function_scope(), G, llvm::Attribute::get(), llvm::ConstantInt::get(), llvm::Attributor::getAAFor(), llvm::InformationCache::getAAResultsForFunction(), getAnchorScope(), getAnchorValue(), getArgNo(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getArgOperand(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getArgumentNo(), getAssociatedArgument(), getAssociatedFunction(), getAssociatedValue(), llvm::AbstractAttribute::getAsStr(), llvm::IntegerState::getAssumed(), llvm::AADereferenceable::getAssumedDereferenceableBytes(), getAttrs(), getBasePointerOfAccessPointerOperand(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getCalledFunction(), llvm::Function::getContext(), llvm::Value::getContext(), getCtxI(), llvm::Attributor::getDataLayout(), llvm::Intrinsic::getDeclaration(), 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::AbstractAttribute::getIRPosition(), llvm::Attribute::getKindAsEnum(), llvm::InformationCache::getMustBeExecutedContextExplorer(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getNumArgOperands(), llvm::Value::getNumUses(), llvm::Instruction::getOpcode(), llvm::InformationCache::getOpcodeInstMapForFunction(), llvm::User::getOperand(), 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::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::InformationCache::getTargetLibraryInfoForFunction(), llvm::BasicBlock::getTerminator(), llvm::ConstantExpr::getTruncOrBitCast(), getType(), llvm::Value::getType(), llvm::BasicBlock::getUniquePredecessor(), llvm::Use::getUser(), llvm::Optional< T >::getValue(), llvm::Attribute::getWithAlignment(), llvm::Attribute::getWithDereferenceableBytes(), llvm::Attribute::getWithDereferenceableOrNullBytes(), llvm::DerefState::GlobalState, hasAttr(), llvm::GlobalValue::hasExactDefinition(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::hasFnAttr(), llvm::Function::hasFnAttribute(), llvm::GlobalValue::hasLocalLinkage(), llvm::Function::hasParamAttribute(), llvm::Function::hasPersonalityFn(), llvm::Optional< T >::hasValue(), I, llvm::IntegerState::indicatePessimisticFixpoint(), initialize(), llvm::IRAttribute< Attribute::NonNull, StateWrapper< BooleanState, AbstractAttribute > >::initialize(), llvm::IRAttribute< AK, Base >::initialize(), llvm::IRAttribute< Attribute::NoReturn, StateWrapper< BooleanState, AbstractAttribute > >::initialize(), llvm::IRAttribute< Attribute::NoCapture, StateWrapper< IntegerState, AbstractAttribute > >::initialize(), llvm::IRAttribute< Attribute::WillReturn, StateWrapper< BooleanState, AbstractAttribute > >::initialize(), llvm::AbstractAttribute::initialize(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::insert(), llvm::SetVector< T, Vector, Set >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), IRP_ARGUMENT, IRP_CALL_SITE_RETURNED, IRP_INVALID, IRP_RETURNED, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::isArgOperand(), llvm::IntegerState::isAssumed(), llvm::AAIsDead::isAssumedDead(), llvm::AANoCapture::isAssumedNoCapture(), llvm::AANoCapture::isAssumedNoCaptureMaybeReturned(), llvm::AANoFree::isAssumedNoFree(), llvm::AANoRecurse::isAssumedNoRecurse(), 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(), llvm::GlobalValue::isDeclaration(), llvm::CaptureTracker::isDereferenceableOrNull(), isFnInterfaceKind(), llvm::isFreeCall(), llvm::isKnownNonZero(), llvm::BasicBlock::isLandingPad(), llvm::isMallocLikeFn(), llvm::CallBase::isMustTailCall(), llvm::Type::isPointerTy(), llvm::AbstractState::isValidState(), llvm::Type::isVoidTy(), isVolatile(), LLVM_DEBUG, llvm_unreachable, llvm::SPII::Load, llvm::make_range(), llvm::IRAttribute< AK, Base >::manifest(), llvm::IRAttribute< Attribute::Alignment, StateWrapper< IntegerState, 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::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::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::paramHasAttr(), llvm::PointerMayBeCaptured(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::IntegerState::removeAssumedBits(), removeAttrs(), llvm::Function::removeFnAttr(), llvm::Value::replaceAllUsesWith(), llvm::MipsISD::Ret, returned(), SI, llvm::SyncScope::SingleThread, Size, llvm::SmallVectorBase::size(), llvm::MapVector< KeyT, ValueT, MapType, VectorType >::size(), llvm::SplitBlock(), llvm::SplitBlockPredecessors(), 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(), T, llvm::to_string(), llvm::AbstractAttribute::trackStatistics(), llvm::UNCHANGED, llvm::Unordered, llvm::AbstractAttribute::updateImpl(), llvm::Value::user_empty(), llvm::Value::uses(), and value().

Referenced by getAttrs().

◆ getCtxI() [1/2]

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

}

Return the context instruction, if any.

{

Definition at line 341 of file Attributor.h.

References Arg, F(), and I.

Referenced by getAttrs(), and llvm::Attributor::isAssumedDead().

◆ getCtxI() [2/2]

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

Definition at line 353 of file Attributor.h.

◆ 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 444 of file Attributor.cpp.

Referenced by getAttrs().

◆ isAnyCallSitePosition()

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

Definition at line 472 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 argumnt.

Definition at line 309 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 246 of file Attributor.h.

◆ operator==()

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

Definition at line 243 of file Attributor.h.

◆ removeAttrs()

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

◆ returned()

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

Create a position describing the returned value of F.

Definition at line 178 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

Create a position describing the value of V.

Definition at line 164 of file Attributor.h.

References Arg, argument(), and callsite_returned().

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

Member Data Documentation

◆ EmptyKey

const IRPosition IRPosition::EmptyKey
static

Special DenseMap key values.

{

Definition at line 486 of file Attributor.h.

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

◆ TombstoneKey

const IRPosition IRPosition::TombstoneKey
static

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