|
LLVM
10.0.0
|
} More...
#include "llvm/Transforms/IPO/Attributor.h"
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... | |
}
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.
| enum llvm::IRPosition::Kind : int |
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.
Definition at line 153 of file Attributor.h.
|
inlinevirtual |
Definition at line 146 of file Attributor.h.
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
inlinestatic |
Create a position describing the function scope of F.
Definition at line 180 of file Attributor.h.
References F().
Referenced by llvm::Attributor::checkForAllCallSites(), llvm::Attributor::checkForAllInstructions(), llvm::Attributor::checkForAllReadWriteInstructions(), llvm::Attributor::checkForAllReturnedValues(), llvm::Attributor::checkForAllReturnedValuesAndReturnInsts(), llvm::Attributor::checkForAllUses(), function_scope(), genericValueTraversal(), getAttrs(), llvm::Attributor::identifyDefaultAbstractAttributes(), llvm::Attributor::isAssumedDead(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().
|
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().
|
inline |
Return the Function surrounding the anchor value.
Definition at line 300 of file Attributor.h.
References getFunction().
Referenced by llvm::Attributor::checkForAllUses(), genericValueTraversal(), getAttrs(), AAValueConstantRangeImpl::getConstantRangeFromLVI(), AAValueConstantRangeImpl::getConstantRangeFromSCEV(), llvm::Attributor::getDataLayout(), AAValueConstantRangeImpl::getSCEV(), and llvm::IRAttribute< Attribute::Returned, AbstractAttribute >::initialize().
|
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().
|
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().
| Argument * IRPosition::getAssociatedArgument | ( | ) | const |
Return the associated argument, if any.
}
Definition at line 190 of file Attributor.cpp.
References llvm::Function::arg_size(), assert(), Callee, llvm::numbers::e, getAnchorValue(), llvm::Function::getArg(), getArgNo(), llvm::AbstractCallSite::getCallArgOperandNo(), llvm::AbstractCallSite::getCallbackUses(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getCalledFunction(), llvm::AbstractCallSite::getCalledFunction(), llvm::AbstractCallSite::getNumArgOperands(), getPositionKind(), llvm::Optional< T >::getValue(), llvm::Optional< T >::hasValue(), IRP_ARGUMENT, and llvm::AbstractCallSite::isCallbackCall().
Referenced by getAttrs().
|
inline |
Return the associated function, if any.
Definition at line 268 of file Attributor.h.
References assert(), and getFunction().
Referenced by llvm::Attributor::checkForAllCallSites(), llvm::Attributor::checkForAllInstructions(), llvm::Attributor::checkForAllReadWriteInstructions(), llvm::Attributor::checkForAllReturnedValues(), llvm::Attributor::checkForAllReturnedValuesAndReturnInsts(), function_scope(), getAttrs(), llvm::IRAttributeManifest::manifestAttrs(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().
|
inline |
Return the value this abstract attribute is associated with.
Definition at line 326 of file Attributor.h.
References assert().
Referenced by genericValueTraversal(), getAttrs(), AAValueConstantRangeImpl::getConstantRangeFromLVI(), AAValueConstantRangeImpl::getSCEV(), llvm::IRAttribute< Attribute::Returned, AbstractAttribute >::initialize(), AAValueConstantRangeFloating::initialize(), AAValueConstantRangeCallSiteReturned::initialize(), AAValueConstantRangeImpl::manifest(), llvm::operator<<(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().
|
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().
|
inline |
Return the index in the attribute list for this position.
Definition at line 340 of file Attributor.h.
References llvm::AttributeList::FirstArgIndex, llvm::AttributeList::FunctionIndex, IRP_ARGUMENT, IRP_CALL_SITE, IRP_CALL_SITE_ARGUMENT, IRP_CALL_SITE_RETURNED, IRP_FLOAT, IRP_FUNCTION, IRP_INVALID, IRP_RETURNED, llvm_unreachable, and llvm::AttributeList::ReturnIndex.
Referenced by llvm::IRAttributeManifest::manifestAttrs().
| 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.
| IgnoreSubsumingPositions | Flag 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().
|
inline |
Return the context instruction, if any.
Definition at line 312 of file Attributor.h.
Referenced by AAValueConstantRangeImpl::getAssumedConstantRange(), getAttrs(), AAValueConstantRangeImpl::getKnownConstantRange(), AAValueConstantRangeImpl::initialize(), llvm::Attributor::isAssumedDead(), and AAValueConstantRangeFloating::updateImpl().
|
inline |
Return the associated position kind.
Definition at line 360 of file Attributor.h.
References assert(), and llvm::AMDGPU::HSAMD::Kernel::Key::Attrs.
Referenced by getAssociatedArgument(), getAttrs(), llvm::IRAttributeManifest::manifestAttrs(), llvm::operator<<(), and llvm::SubsumingPositionIterator::SubsumingPositionIterator().
| 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(...).
| IgnoreSubsumingPositions | Flag 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().
|
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().
|
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().
|
inline |
Definition at line 253 of file Attributor.h.
|
inline |
Definition at line 250 of file Attributor.h.
References AnchorVal, and KindOrArgNo.
|
inline |
Remove the attribute of kind AKs existing in the IR at this position.
Definition at line 416 of file Attributor.h.
References llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::getAttributes(), llvm::AttributeList::getAttributes(), llvm::AttributeList::removeAttribute(), and llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, CallBrTy, IterTy >::setAttributes().
Referenced by getAttrs().
|
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().
|
inlinestatic |
Create a position describing the value of V.
Definition at line 171 of file Attributor.h.
References Arg, argument(), and callsite_returned().
Referenced by AAValueConstantRangeFloating::calculateBinaryOperator(), AAValueConstantRangeFloating::calculateCmpInst(), getAttrs(), llvm::Attributor::identifyDefaultAbstractAttributes(), llvm::SubsumingPositionIterator::SubsumingPositionIterator(), and AAValueConstantRangeFloating::updateImpl().
|
protected |
The value this position is anchored at.
Definition at line 471 of file Attributor.h.
Referenced by getAttrs(), and operator==().
|
static |
Special DenseMap key values.
{
Definition at line 451 of file Attributor.h.
Referenced by llvm::DenseMapInfo< IRPosition >::getEmptyKey(), and llvm::IRAttributeManifest::manifestAttrs().
|
protected |
The argument number, if non-negative, or the position "kind".
Definition at line 474 of file Attributor.h.
Referenced by getAttrs(), and operator==().
|
static |
Definition at line 452 of file Attributor.h.
Referenced by llvm::DenseMapInfo< IRPosition >::getTombstoneKey(), and llvm::IRAttributeManifest::manifestAttrs().
1.8.13