LLVM 20.0.0git
|
#include "llvm/IR/Metadata.h"
Public Types | |
using | op_iterator = const MDOperand * |
using | op_range = iterator_range< op_iterator > |
Public Types inherited from llvm::Metadata | |
enum | MetadataKind |
Static Public Member Functions | |
static MDTuple * | get (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static MDTuple * | getIfExists (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static MDTuple * | getDistinct (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static TempMDTuple | getTemporary (LLVMContext &Context, ArrayRef< Metadata * > MDs) |
static void | deleteTemporary (MDNode *N) |
Deallocate a node created by getTemporary. | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithPermanent (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a permanent one. | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithUniqued (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a uniqued one. | |
template<class T > | |
static std::enable_if_t< std::is_base_of< MDNode, T >::value, T * > | replaceWithDistinct (std::unique_ptr< T, TempMDNodeDeleter > N) |
Replace a temporary node with a distinct one. | |
static bool | classof (const Metadata *MD) |
Methods for support type inquiry through isa, cast, and dyn_cast: | |
static MDNode * | concatenate (MDNode *A, MDNode *B) |
Methods for metadata merging. | |
static MDNode * | intersect (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericTBAA (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericFPMath (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericRange (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericNoaliasAddrspace (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericAliasScope (MDNode *A, MDNode *B) |
static MDNode * | getMostGenericAlignmentOrDereferenceable (MDNode *A, MDNode *B) |
static MDNode * | getMergedProfMetadata (MDNode *A, MDNode *B, const Instruction *AInstr, const Instruction *BInstr) |
Merge !prof metadata from two instructions. | |
Protected Types | |
using | mutable_op_range = iterator_range< MDOperand * > |
Protected Types inherited from llvm::Metadata | |
enum | StorageType { Uniqued , Distinct , Temporary } |
Active type of storage. More... | |
Protected Member Functions | |
MDNode (LLVMContext &Context, unsigned ID, StorageType Storage, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2={}) | |
~MDNode ()=default | |
void * | operator new (size_t Size, size_t NumOps, StorageType Storage) |
void | operator delete (void *Mem) |
void | operator delete (void *, unsigned) |
Required by std, but never called. | |
void | operator delete (void *, unsigned, bool) |
Required by std, but never called. | |
void | dropAllReferences () |
MDOperand * | mutable_begin () |
MDOperand * | mutable_end () |
mutable_op_range | mutable_operands () |
void | setOperand (unsigned I, Metadata *New) |
Set an operand. | |
unsigned | getNumUnresolved () const |
void | setNumUnresolved (unsigned N) |
void | storeDistinctInContext () |
void | resize (size_t NumOps) |
Resize the node to hold NumOps operands. | |
Protected Member Functions inherited from llvm::Metadata | |
Metadata (unsigned ID, StorageType Storage) | |
~Metadata ()=default | |
void | handleChangedOperand (void *, Metadata *) |
Default handling of a changed operand, which asserts. | |
Static Protected Member Functions | |
template<class T , class StoreT > | |
static T * | storeImpl (T *N, StorageType Storage, StoreT &Store) |
template<class T > | |
static T * | storeImpl (T *N, StorageType Storage) |
Friends | |
class | ReplaceableMetadataImpl |
class | LLVMContextImpl |
class | DIAssignID |
Additional Inherited Members | |
Protected Attributes inherited from llvm::Metadata | |
unsigned char | Storage: 7 |
Storage flag for non-uniqued, otherwise unowned, metadata. | |
unsigned char | SubclassData1: 1 |
unsigned short | SubclassData16 = 0 |
unsigned | SubclassData32 = 0 |
Metadata node.
Metadata nodes can be uniqued, like constants, or distinct. Temporary metadata nodes (with full support for RAUW) can be used to delay uniquing until forward references are known. The basic metadata node is an MDTuple.
There is limited support for RAUW at construction time. At construction time, if any operand is a temporary node (or an unresolved uniqued node, which indicates a transitive temporary operand), the node itself will be unresolved. As soon as all operands become resolved, it will drop RAUW support permanently.
If an unresolved node is part of a cycle, resolveCycles() needs to be called on some member of the cycle once all temporary nodes have been replaced.
MDNodes can be large or small, as well as resizable or non-resizable. Large MDNodes' operands are allocated in a separate storage vector, whereas small MDNodes' operands are co-allocated. Distinct and temporary MDnodes are resizable, but only MDTuples support this capability.
Clients can add operands to resizable MDNodes using push_back().
Definition at line 1069 of file Metadata.h.
|
protected |
Definition at line 1205 of file Metadata.h.
using llvm::MDNode::op_iterator = const MDOperand * |
Definition at line 1417 of file Metadata.h.
Definition at line 1418 of file Metadata.h.
|
protected |
Definition at line 650 of file Metadata.cpp.
References isUniqued(), and setOperand().
|
protecteddefault |
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 1439 of file Metadata.h.
References llvm::Metadata::getMetadataID().
TempMDNode MDNode::clone | ( | ) | const |
Create a (temporary) clone of this.
Definition at line 667 of file Metadata.cpp.
References llvm::Metadata::getMetadataID(), and llvm_unreachable.
Referenced by llvm::DIType::clone(), and llvm::DILocalScope::cloneScopeForSubprogram().
Methods for metadata merging.
Definition at line 1114 of file Metadata.cpp.
References A, B, llvm::SetVector< T, Vector, Set, N >::getArrayRef(), getOrSelfReference(), and llvm::SetVector< T, Vector, Set, N >::insert().
Referenced by AddAliasScopeMetadata(), llvm::LoopVersioning::annotateInstWithNoAlias(), PropagateCallSiteMetadata(), and propagateMemProfHelper().
|
static |
Deallocate a node created by getTemporary.
Calls replaceAllUsesWith(nullptr)
before deleting, so any remaining references will be reset.
Definition at line 1049 of file Metadata.cpp.
Referenced by LLVMDisposeTemporaryMDNode(), LLVMMetadataReplaceAllUsesWith(), and llvm::TempMDNodeDeleter::operator()().
|
protected |
Definition at line 907 of file Metadata.cpp.
References getNumOperands(), I, and setOperand().
LLVM_DUMP_METHOD void MDNode::dumpTree | ( | ) | const |
User-friendly dump in tree shape.
If M
is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.
Note: this uses an explicit overload instead of default arguments so that the nullptr version is easy to call from a debugger.
Definition at line 5346 of file AsmWriter.cpp.
References dumpTree().
Referenced by dumpTree().
LLVM_DUMP_METHOD void MDNode::dumpTree | ( | const Module * | M | ) | const |
Definition at line 5349 of file AsmWriter.cpp.
References llvm::dbgs(), and printTree().
|
inlinestatic |
Definition at line 1543 of file Metadata.h.
References llvm::MDTuple::get().
Referenced by llvm::adaptNoAliasScopes(), AddAliasScopeMetadata(), addModuleFlags(), addRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), llvm::LoopVersioning::annotateInstWithNoAlias(), llvm::annotateValueSite(), llvm::DIExpression::append(), llvm::DIExpression::appendOpsToArg(), llvm::OpenMPIRBuilder::applySimd(), llvm::memprof::CallStackTrie::buildAndAttachMIBMetadata(), llvm::memprof::buildCallstackMetadata(), canonicalizeMetadataForValue(), llvm::DILocation::cloneWithDiscriminator(), collectCallSiteParameters(), llvm::DIExpression::constantFold(), constructEntryMetadata(), llvm::DIExpression::convertToNonVariadicExpression(), llvm::DIExpression::convertToUndefExpression(), llvm::DIExpression::convertToVariadicExpression(), llvm::GlobalObject::copyMetadata(), llvm::copyRangeMetadata(), llvm::coro::BaseCloner::create(), createAccessTag(), llvm::MDBuilder::createAliasScope(), llvm::MDBuilder::createAliasScopeDomain(), llvm::DIBuilder::createArrayType(), llvm::DIBuilder::createBasicType(), llvm::DIBuilder::createBitFieldMemberType(), llvm::MDBuilder::createBranchWeights(), llvm::MDBuilder::createCallbackEncoding(), llvm::MDBuilder::createCallees(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createCommonBlock(), llvm::DIBuilder::createConstantValueExpression(), createDecorationIntrinsic(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), llvm::DIBuilder::createExpression(), CreateFailBB(), llvm::DIBuilder::createFile(), llvm::DIBuilder::createForwardDecl(), llvm::MDBuilder::createFPMath(), llvm::DIExpression::createFragmentExpression(), llvm::DIBuilder::createFriend(), llvm::MDBuilder::createFunctionEntryCount(), llvm::MDBuilder::createFunctionSectionPrefix(), llvm::DIBuilder::createGlobalVariableExpression(), createImportedModule(), llvm::DIBuilder::createInheritance(), llvm::MDBuilder::createIrrLoopHeaderWeight(), llvm::DIBuilder::createLabel(), llvm::DIBuilder::createLexicalBlockFile(), llvm::MDBuilder::createLLVMStats(), createLocalVariable(), llvm::DIBuilder::createMacro(), llvm::DIBuilder::createMemberPointerType(), llvm::DIBuilder::createMemberType(), llvm::createMemCpyLoopKnownSize(), createMIBNode(), llvm::DIBuilder::createModule(), llvm::DIBuilder::createNameSpace(), llvm::DIBuilder::createObjCIVar(), llvm::DIBuilder::createObjCProperty(), llvm::OpenMPIRBuilder::createOffloadEntriesAndInfoMetadata(), llvm::OpenMPIRBuilder::createOffloadEntry(), createOutlinedFunction(), llvm::MDBuilder::createPCSections(), llvm::createPGONameMetadata(), llvm::DIBuilder::createPointerType(), llvm::MDBuilder::createPseudoProbeDesc(), llvm::DIBuilder::createPtrAuthQualifiedType(), llvm::DIBuilder::createQualifiedType(), llvm::MDBuilder::createRange(), llvm::DIBuilder::createReferenceType(), createRoundingModeDecoration(), llvm::MDBuilder::createRTTIPointerPrologue(), createSaturatedConversionDecoration(), llvm::DIBuilder::createSetType(), llvm::DIBuilder::createStaticMemberType(), createStringMetadata(), llvm::DIBuilder::createStringType(), llvm::DIBuilder::createStructType(), llvm::DIBuilder::createSubroutineType(), llvm::MDBuilder::createTBAAAccessTag(), llvm::MDBuilder::createTBAANode(), llvm::MDBuilder::createTBAARoot(), llvm::MDBuilder::createTBAAScalarTypeNode(), llvm::MDBuilder::createTBAAStructNode(), llvm::MDBuilder::createTBAAStructTagNode(), llvm::MDBuilder::createTBAAStructTypeNode(), llvm::MDBuilder::createTBAATypeNode(), llvm::DIBuilder::createTemplateAlias(), llvm::DIBuilder::createTemplateParameterPack(), llvm::DIBuilder::createTemplateTypeParameter(), createTemplateValueParameterHelper(), llvm::DIBuilder::createTypedef(), llvm::DIBuilder::createUnionType(), llvm::MDBuilder::createUnpredictable(), llvm::DIBuilder::createUnspecifiedType(), llvm::DIBuilder::createVariantMemberType(), llvm::DIBuilder::createVariantPart(), llvm::DIBuilder::createVectorType(), llvm::TargetInstrInfo::describeLoadedValue(), llvm::MipsInstrInfo::describeLoadedValue(), llvm::X86InstrInfo::describeLoadedValue(), describeMOVrrLoadedValue(), describeORRLoadedValue(), DisableAllLoopOptsOnLoop(), llvm::Instruction::dropLocation(), llvm::embedBufferInModule(), llvm::emitAMDGPUPrintfCall(), emitDbgAssign(), emitDXILVersionTupleMD(), emitResourceMetadata(), emitShaderModelVersionMD(), emitTopLevelLibraryNode(), emitValidatorVersionMD(), llvm::InstrumentationIRBuilder::ensureDebugInfo(), llvm::AAMDNodes::extendToTBAA(), llvm::DIExpression::extractAddressClass(), extractMDNode(), llvm::DIBuilder::finalize(), findBasePointer(), fixupDebugInfoPostExtraction(), llvm::DIExpression::foldConstantMath(), llvm::hlsl::FrontendResource::FrontendResource(), llvm::dxil::ResourceBindingInfo::getAsMetadata(), getEntryPropAsMetadata(), llvm::DebugLoc::getFnDebugLoc(), llvm::DILocation::getMergedLocation(), getMostGenericNoaliasAddrspace(), getMostGenericRange(), llvm::offloading::getOffloadingEntryInitializer(), llvm::DIBuilder::getOrCreateGenericSubrange(), llvm::OpenMPIRBuilder::getOrCreateRuntimeFunction(), llvm::DIBuilder::getOrCreateSubrange(), llvm::DIBuilder::getOrCreateTypeArray(), getOrSelfReference(), getSubprogram(), hostParallelCallback(), llvm::FunctionImporter::importFunctions(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::SampleProfileProber::instrumentOneFunc(), interpretValues(), llvm::intersectAccessGroups(), LLVMDIBuilderCreateDebugLocation(), LLVMMDNodeInContext(), LLVMMDNodeInContext2(), lowerKernelArguments(), lowerPtrAnnotation(), llvm::makeFollowupLoopID(), llvm::MDBuilder::mergeCallbackEncodings(), moveFunctionData(), parseAnnotation(), postUnswitch(), llvm::LoopVersioning::prepareNoAliasMetadata(), llvm::DIExpression::prependOpcodes(), llvm::memtag::readRegister(), llvm::DIExpression::replaceArg(), llvm::DebugLoc::replaceInlinedAtSubprogram(), llvm::AssignGUIDPass::run(), runImpl(), llvm::scaleProfData(), llvm::LoopVectorizeHints::setAlreadyVectorized(), llvm::setKCFIType(), llvm::Loop::setLoopAlreadyUnrolled(), llvm::Loop::setLoopMustProgress(), llvm::Instruction::setNoSanitizeMetadata(), llvm::IRBuilderBase::SetNoSanitizeMetadata(), llvm::GlobalObject::setVCallVisibilityMetadata(), llvm::AAMDNodes::shiftTBAAStruct(), splitGlobal(), stripLoopMDLoc(), llvm::stripNonLineTableDebugInfo(), llvm::uniteAccessGroups(), llvm::OpenMPIRBuilder::unrollLoopFull(), llvm::OpenMPIRBuilder::unrollLoopHeuristic(), llvm::OpenMPIRBuilder::unrollLoopPartial(), updateNVPTXMetadata(), upgradeAMDGCNIntrinsicCall(), llvm::UpgradeModuleFlags(), upgradeNVVMIntrinsicCall(), llvm::UpgradeTBAANode(), upgradeX86IntrinsicCall(), llvm::InstCombinerImpl::visitCallInst(), llvm::dxil::UAVResource::write(), llvm::dxil::ConstantBuffer::write(), llvm::dxil::ResourceBase::ExtendedProperties::write(), and llvm::dxil::ResourceTable< T >::write().
|
inline |
Definition at line 1233 of file Metadata.h.
Referenced by llvm::DIExpression::append(), llvm::DIExpression::appendOpsToArg(), buildFrameDebugInfo(), llvm::DILocation::cloneWithDiscriminator(), llvm::DIExpression::constantFold(), llvm::DIExpression::convertToNonVariadicExpression(), llvm::DIExpression::convertToUndefExpression(), llvm::DIExpression::convertToVariadicExpression(), createAccessTag(), llvm::DbgVariableRecord::createDebugIntrinsic(), llvm::DIExpression::createFragmentExpression(), createOrReplaceFragment(), dropInitialDeref(), TransferTracker::emitMOLoc(), llvm::AAMDNodes::extendToTBAA(), llvm::DIExpression::extractAddressClass(), fixupLineNumbers(), llvm::DIExpression::foldConstantMath(), llvm::DILocation::getMergedLocation(), getOrCreateDebugLoc(), llvm::makeFollowupLoopID(), llvm::DIExpression::prependOpcodes(), llvm::at::remapAssignID(), llvm::DIExpression::replaceArg(), llvm::DbgVariableIntrinsic::setVariable(), llvm::AAMDNodes::shiftTBAAStruct(), storeDistinctInContext(), transferSRADebugInfo(), llvm::uniteAccessGroups(), updateLoopMetadataDebugLocationsImpl(), and llvm::UpgradeTBAANode().
|
inlinestatic |
Definition at line 1551 of file Metadata.h.
References llvm::MDTuple::getDistinct().
Referenced by addBasicBlockMetadata(), llvm::DebugLoc::appendInlinedAt(), llvm::OpenMPIRBuilder::applySimd(), llvm::DICompositeType::buildODRType(), llvm::MDBuilder::createAnonymousAARoot(), llvm::DIBuilder::createCompileUnit(), llvm::DIBuilder::createGlobalVariableExpression(), llvm::DIBuilder::createLexicalBlock(), getSubprogram(), llvm::makePostTransformationMetadata(), llvm::sandboxir::Region::Region(), stripLoopMDLoc(), and updateLoopMetadataDebugLocationsImpl().
|
inlinestatic |
Definition at line 1547 of file Metadata.h.
References llvm::MDTuple::getIfExists().
|
static |
Merge !prof metadata from two instructions.
Currently only implemented with direct callsites with branch weights.
Definition at line 1222 of file Metadata.cpp.
References A, assert(), B, llvm::CallBase::getCalledFunction(), and llvm::Instruction::getMetadata().
Referenced by llvm::combineMetadata().
Definition at line 1141 of file Metadata.cpp.
References A, B, llvm::SmallPtrSetImpl< PtrType >::contains(), llvm::SetVector< T, Vector, Set, N >::empty(), llvm::SetVector< T, Vector, Set, N >::getArrayRef(), getDomain(), getOrSelfReference(), llvm::SetVector< T, Vector, Set, N >::insert(), and llvm::SmallPtrSetImpl< PtrType >::insert().
Referenced by llvm::combineMetadata(), llvm::AAMDNodes::concat(), llvm::AAMDNodes::merge(), and llvm::propagateMetadata().
Definition at line 1394 of file Metadata.cpp.
References A, B, and llvm::ConstantInt::getZExtValue().
Referenced by llvm::combineMetadata().
Definition at line 1173 of file Metadata.cpp.
Referenced by llvm::combineMetadata(), and llvm::propagateMetadata().
Definition at line 1357 of file Metadata.cpp.
References A, B, llvm::ConstantAsMetadata::get(), get(), I, llvm::ConstantRangeList::intersectWith(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by llvm::combineMetadata().
Definition at line 1284 of file Metadata.cpp.
References A, addRange(), B, llvm::ConstantAsMetadata::get(), get(), llvm::ConstantInt::getValue(), I, llvm::ConstantRange::isFullSet(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), Range, llvm::SmallVectorImpl< T >::reserve(), llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorBase< Size_T >::size(), Size, llvm::APInt::slt(), and tryMergeRange().
Referenced by llvm::combineMetadata().
Definition at line 477 of file TypeBasedAliasAnalysis.cpp.
References A, B, and matchAccessTags().
Referenced by llvm::combineMetadata(), llvm::AAMDNodes::merge(), and llvm::propagateMetadata().
|
inline |
Return number of MDNode operands.
Definition at line 1436 of file Metadata.h.
Referenced by llvm::AbstractCallSite::AbstractCallSite(), llvm::memprof::CallStackTrie::addCallStack(), addRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), addToAccessGroupList(), llvm::buildOpSpirvDecorations(), llvm::cacheAnnotationFromMD(), computeFunctionSummary(), createAccessTag(), dropAllReferences(), llvm::extractProfTotalWeight(), llvm::findOptionMDForLoopID(), llvm::findStringMetadataForLoop(), flatInstrMayAccessPrivate(), llvm::hlsl::FrontendResource::FrontendResource(), getConstInt(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeAttributes(), llvm::ProfileSummary::getFromMD(), GetFunctionFromMDNode(), llvm::AMDGPUMachineFunction::getLDSKernelIdMetadata(), getLocCookie(), llvm::MachineInstr::getLocCookieMD(), llvm::Loop::getLoopID(), llvm::MachineLoop::getLoopID(), llvm::memprof::getMIBAllocType(), llvm::memprof::getMIBStackNode(), llvm::getNumBranchWeights(), llvm::GenericDINode::getNumDwarfOperands(), getOperand(), llvm::getOptionalBoolLoopAttribute(), getOptionalVal(), llvm::DILocation::getRawInlinedAt(), getSummaryFromMD(), llvm::GetUnrollMetadata(), getValMD(), llvm::getValueProfDataFromInst(), haveCommonPrefix(), llvm::intersectAccessGroups(), isKeyValuePair(), AliasScopeTracker::isNoAliasScopeDeclDead(), IsRootTBAANode(), IsScalarTBAANodeImpl(), isStructPathTBAA(), isTBAAVtableAccess(), llvm::SPIRVCallLowering::lowerFormalArguments(), llvm::makeFollowupLoopID(), llvm::mayHaveValueProfileOfKind(), llvm::MDBuilder::mergeCallbackEncodings(), llvm::MDTuple::pop_back(), propagateMemProfHelper(), llvm::MDTuple::push_back(), llvm::readIntVecFromMDNode(), llvm::scaleProfData(), llvm::Loop::setLoopID(), setOperand(), llvm::AAMDNodes::shiftTBAAStruct(), unrollAndJamCountPragmaValue(), unrollCountPragmaValue(), updateLoopMetadataDebugLocationsImpl(), llvm::UpgradeTBAANode(), and llvm::TBAAVerifier::visitTBAAMetadata().
|
inline |
Definition at line 1258 of file Metadata.h.
References assert(), and isTemporary().
|
inlineprotected |
Definition at line 1351 of file Metadata.h.
Referenced by isResolved(), and storeDistinctInContext().
Definition at line 1430 of file Metadata.h.
References assert(), getNumOperands(), and I.
Referenced by llvm::AbstractCallSite::AbstractCallSite(), AccessQualFromMD(), llvm::DwarfUnit::addAnnotation(), llvm::memprof::CallStackTrie::addCallStack(), addRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), ArgTypeFromMD(), llvm::buildOpSpirvDecorations(), llvm::cacheAnnotationFromMD(), collectReqs(), computeFunctionSummary(), llvm::MDBuilder::createMutableTBAAAccessTag(), llvm::TargetLoweringObjectFile::emitCGProfileMetadata(), llvm::MachineInstr::emitInlineAsmError(), llvm::AsmPrinter::emitPCSections(), llvm::extractProfTotalWeight(), llvm::findOptionMDForLoopID(), llvm::findStringMetadataForLoop(), flatInstrMayAccessPrivate(), generateAssignInstrs(), GetArgMD(), llvm::AbstractCallSite::getCallbackUses(), getConstInt(), llvm::GenericDINode::getDwarfOperand(), llvm::DOTGraphTraits< DOTFuncInfo * >::getEdgeAttributes(), llvm::hlsl::FrontendResource::getElementType(), llvm::FPMathOperator::getFPAccuracy(), llvm::ProfileSummary::getFromMD(), GetFunctionFromMDNode(), llvm::hlsl::FrontendResource::getGlobalVariable(), llvm::hlsl::FrontendResource::getIsROV(), llvm::AMDGPUMachineFunction::getLDSKernelIdMetadata(), getLinkedToSymbol(), getLocCookie(), llvm::MachineInstr::getLocCookieMD(), llvm::Loop::getLoopID(), llvm::MachineLoop::getLoopID(), llvm::memprof::getMIBAllocType(), llvm::memprof::getMIBStackNode(), getOCLKernelArgAttribute(), llvm::DINode::getOperandAs(), llvm::DIMacroNode::getOperandAs(), llvm::getOptionalBoolLoopAttribute(), getOptionalVal(), getOriginalFunctionType(), llvm::DICompositeType::getRawAllocated(), llvm::DIDerivedType::getRawAnnotations(), llvm::DICompositeType::getRawAnnotations(), llvm::DIGlobalVariable::getRawAnnotations(), llvm::DILocalVariable::getRawAnnotations(), llvm::DICompositeType::getRawAssociated(), llvm::DICompositeType::getRawBaseType(), llvm::DIGenericSubrange::getRawCountNode(), llvm::DICompositeType::getRawDataLocation(), llvm::DICommonBlock::getRawDecl(), llvm::DICompositeType::getRawDiscriminator(), llvm::DICompositeType::getRawElements(), llvm::DIMacroFile::getRawElements(), llvm::DICompileUnit::getRawEnumTypes(), llvm::DIGlobalVariableExpression::getRawExpression(), llvm::DIDerivedType::getRawExtraData(), llvm::DIScope::getRawFile(), llvm::DIVariable::getRawFile(), llvm::DICommonBlock::getRawFile(), llvm::DILabel::getRawFile(), llvm::DIObjCProperty::getRawFile(), llvm::DIMacroFile::getRawFile(), llvm::DICompileUnit::getRawGlobalVariables(), llvm::DICompileUnit::getRawImportedEntities(), llvm::DILocation::getRawInlinedAt(), llvm::DIGenericSubrange::getRawLowerBound(), llvm::DICompileUnit::getRawMacros(), llvm::DICompositeType::getRawRank(), llvm::DICompileUnit::getRawRetainedTypes(), llvm::DIType::getRawScope(), llvm::DILocation::getRawScope(), llvm::DILexicalBlockBase::getRawScope(), llvm::DINamespace::getRawScope(), llvm::DIVariable::getRawScope(), llvm::DICommonBlock::getRawScope(), llvm::DILabel::getRawScope(), llvm::DICompositeType::getRawSpecification(), llvm::DIGlobalVariable::getRawStaticDataMemberDeclaration(), llvm::DIGenericSubrange::getRawStride(), llvm::DIStringType::getRawStringLength(), llvm::DIStringType::getRawStringLengthExp(), llvm::DIStringType::getRawStringLocationExp(), llvm::DICompositeType::getRawTemplateParams(), llvm::DIGlobalVariable::getRawTemplateParams(), llvm::DITemplateParameter::getRawType(), llvm::DIVariable::getRawType(), llvm::DIObjCProperty::getRawType(), llvm::DISubroutineType::getRawTypeArray(), llvm::DIGenericSubrange::getRawUpperBound(), llvm::DIGlobalVariableExpression::getRawVariable(), llvm::DICompositeType::getRawVTableHolder(), llvm::hlsl::FrontendResource::getResourceIndex(), llvm::hlsl::FrontendResource::getResourceKind(), llvm::hlsl::FrontendResource::getSpace(), getSummaryFromMD(), llvm::RISCVTargetLowering::getTargetMMOFlags(), llvm::GetUnrollMetadata(), getValMD(), llvm::DITemplateValueParameter::getValue(), llvm::getValueProfDataFromInst(), hasAnyUnrollPragma(), llvm::hasBranchWeightOrigin(), isKeyValuePair(), AliasScopeTracker::isNoAliasScopeDeclDead(), IsScalarTBAANodeImpl(), isStructPathTBAA(), isTBAAVtableAccess(), llvm::lookupPGONameFromMetadata(), llvm::makeFollowupLoopID(), llvm::mayHaveValueProfileOfKind(), llvm::MDBuilder::mergeCallbackEncodings(), llvm::readIntVecFromMDNode(), replaceOperandWith(), llvm::scaleProfData(), llvm::Loop::setLoopID(), llvm::AAMDNodes::shiftTBAAStruct(), unrollAndJamCountPragmaValue(), unrollCountPragmaValue(), updateLoopMetadataDebugLocationsImpl(), updateNVPTXMetadata(), llvm::UpgradeTBAANode(), and llvm::TBAAVerifier::visitTBAAMetadata().
|
inlinestatic |
Definition at line 1555 of file Metadata.h.
References llvm::MDTuple::getTemporary().
Referenced by llvm::DIBuilder::createReplaceableCompositeType(), llvm::DIBuilder::createTempFunctionFwdDecl(), llvm::DIBuilder::createTempGlobalVariableFwdDecl(), and llvm::DIBuilder::createTempMacroFile().
Definition at line 1128 of file Metadata.cpp.
References A, B, llvm::SmallPtrSetImpl< PtrType >::count(), llvm::SetVector< T, Vector, Set, N >::getArrayRef(), getOrSelfReference(), and llvm::SetVector< T, Vector, Set, N >::remove_if().
Referenced by llvm::combineMetadata(), llvm::AAMDNodes::concat(), llvm::AAMDNodes::merge(), and llvm::propagateMetadata().
|
inline |
Definition at line 1256 of file Metadata.h.
References llvm::Metadata::getMetadataID().
Referenced by isReplaceable().
|
inline |
Definition at line 1252 of file Metadata.h.
References llvm::Metadata::Distinct, and llvm::Metadata::Storage.
Referenced by llvm::DIType::mutate().
|
inline |
Definition at line 1255 of file Metadata.h.
References isAlwaysReplaceable(), and isTemporary().
Referenced by replaceAllUsesWith().
|
inline |
Check if node is fully resolved.
If isTemporary(), this always returns false
; if isDistinct(), this always returns true
.
If isUniqued(), returns true
if this has already dropped RAUW support (because all operands are resolved).
As forward declarations are resolved, their containers should get resolved automatically. However, if this (or one of its operands) is involved in a cycle, resolveCycles() needs to be called explicitly.
Definition at line 1249 of file Metadata.h.
References getNumUnresolved(), and isTemporary().
Referenced by resolve(), resolveCycles(), and storeDistinctInContext().
bool MDNode::isTBAAVtableAccess | ( | ) | const |
Check whether MDNode is a vtable access.
Definition at line 454 of file TypeBasedAliasAnalysis.cpp.
References getNumOperands(), getOperand(), isStructPathTBAA(), and llvm::Tag.
|
inline |
Definition at line 1253 of file Metadata.h.
References llvm::Metadata::Storage, and llvm::Metadata::Temporary.
Referenced by getNumTemporaryUses(), isReplaceable(), isResolved(), and llvm::MetadataLoader::MetadataLoaderImpl::parseMetadataAttachment().
|
inline |
Definition at line 1251 of file Metadata.h.
References llvm::Metadata::Storage, and llvm::Metadata::Uniqued.
Referenced by MDNode(), replaceOperandWith(), llvm::DILexicalBlockBase::replaceScope(), resize(), resolve(), and setOperand().
|
inlineprotected |
Definition at line 1202 of file Metadata.h.
Referenced by mutable_operands(), op_begin(), replaceOperandWith(), and setOperand().
|
inlineprotected |
Definition at line 1203 of file Metadata.h.
Referenced by mutable_operands(), and op_end().
|
inlineprotected |
Definition at line 1207 of file Metadata.h.
References mutable_begin(), and mutable_end().
|
inline |
Definition at line 1420 of file Metadata.h.
References mutable_begin().
Referenced by llvm::GenericDINode::dwarf_op_begin(), and haveCommonPrefix().
|
inline |
Definition at line 1424 of file Metadata.h.
References mutable_end().
Referenced by llvm::GenericDINode::dwarf_op_end(), and haveCommonPrefix().
Definition at line 1428 of file Metadata.h.
Referenced by llvm::AbstractCallSite::AbstractCallSite(), addBasicBlockMetadata(), llvm::memprof::CallStackTrie::addCallStack(), addOpsFromMDNode(), addToAccessGroupList(), annotateFunctionWithHashMismatch(), llvm::TargetLoweringObjectFile::emitCGProfileMetadata(), llvm::AsmPrinter::emitPCSections(), llvm::AAMDNodes::extendToTBAA(), llvm::findOptionMDForLoopID(), llvm::AbstractCallSite::getCallbackUses(), getOCLKernelArgAttribute(), getSummaryFromMD(), llvm::GetUnrollMetadata(), llvm::hasInstrProfHashMismatch(), llvm::intersectAccessGroups(), llvm::Loop::isAnnotatedParallel(), llvm::SPIRVCallLowering::lowerFormalArguments(), llvm::makeFollowupLoopID(), llvm::makePostTransformationMetadata(), llvm::MMRAMetadata::MMRAMetadata(), propagateMemProfHelper(), and resolveCycles().
|
inlineprotected |
Required by std, but never called.
Definition at line 1191 of file Metadata.h.
References llvm_unreachable.
Required by std, but never called.
Definition at line 1196 of file Metadata.h.
References llvm_unreachable.
|
protected |
Definition at line 643 of file Metadata.cpp.
|
protected |
Definition at line 633 of file Metadata.cpp.
References llvm::alignTo(), H, and Size.
|
delete |
void MDNode::printTree | ( | raw_ostream & | OS, |
const Module * | M = nullptr |
||
) | const |
Print in tree shape.
Prints definition of this
in tree shape.
If M
is provided, metadata nodes will be numbered canonically; otherwise, pointer addresses are substituted.
Definition at line 5271 of file AsmWriter.cpp.
References OS, and printMetadataImpl().
Referenced by dumpTree().
void MDNode::printTree | ( | raw_ostream & | OS, |
ModuleSlotTracker & | MST, | ||
const Module * | M = nullptr |
||
) | const |
Definition at line 5277 of file AsmWriter.cpp.
References OS, and printMetadataImpl().
|
inline |
RAUW a temporary.
true
. Definition at line 1266 of file Metadata.h.
References assert(), and isReplaceable().
Referenced by llvm::at::RAUW().
Replace a specific operand.
Definition at line 1077 of file Metadata.cpp.
References getOperand(), I, isUniqued(), mutable_begin(), and setOperand().
Referenced by addBasicBlockMetadata(), addRuntimeUnrollDisableMetaData(), llvm::addStringMetadataToLoop(), buildFrameDebugInfo(), llvm::MDBuilder::createAnonymousAARoot(), DisableAllLoopOptsOnLoop(), llvm::makeFollowupLoopID(), llvm::makePostTransformationMetadata(), llvm::GenericDINode::replaceDwarfOperandWith(), llvm::DIMacroFile::replaceElements(), llvm::DICompositeType::replaceElements(), llvm::DICompileUnit::replaceEnumTypes(), llvm::DICompileUnit::replaceGlobalVariables(), llvm::DICompileUnit::replaceImportedEntities(), llvm::DICompileUnit::replaceMacros(), llvm::DICompileUnit::replaceRetainedTypes(), llvm::DICompositeType::replaceTemplateParams(), llvm::DICompositeType::replaceVTableHolder(), stripLoopMDLoc(), updateLoopMetadataDebugLocationsImpl(), and updateNVPTXMetadata().
|
inlinestatic |
Replace a temporary node with a distinct one.
Create a distinct version of N
– in place, if possible – and return it. Takes ownership of the temporary node.
Definition at line 1311 of file Metadata.h.
References N.
Referenced by llvm::DIBuilder::createArtificialSubprogram().
|
inlinestatic |
Replace a temporary node with a permanent one.
Try to create a uniqued version of N
– in place, if possible – and return it. If N
cannot be uniqued, return a distinct node instead.
Definition at line 1289 of file Metadata.h.
References N.
|
inlinestatic |
Replace a temporary node with a uniqued one.
Create a uniqued version of N
– in place, if possible – and return it. Takes ownership of the temporary node.
Definition at line 1301 of file Metadata.h.
References N.
Referenced by llvm::DILocalScope::cloneScopeForSubprogram(), createTypeWithFlags(), and llvm::DIBuilder::replaceTemporary().
|
inlineprotected |
Resize the node to hold NumOps operands.
Definition at line 1363 of file Metadata.h.
References assert(), llvm::Metadata::getMetadataID(), and isUniqued().
Referenced by llvm::MDTuple::pop_back(), and llvm::MDTuple::push_back().
void MDNode::resolve | ( | ) |
Resolve a unique, unresolved node.
Definition at line 795 of file Metadata.cpp.
References assert(), isResolved(), isUniqued(), and setNumUnresolved().
Referenced by resolveCycles().
void MDNode::resolveCycles | ( | ) |
Resolve cycles.
Once all forward declarations have been resolved, force cycles to be resolved.
Definition at line 841 of file Metadata.cpp.
References assert(), isResolved(), N, operands(), and resolve().
|
inlineprotected |
Set an operand.
Sets the operand directly, without worrying about uniquing.
Definition at line 1089 of file Metadata.cpp.
References assert(), getNumOperands(), I, isUniqued(), mutable_begin(), and llvm::MDOperand::reset().
Referenced by dropAllReferences(), MDNode(), llvm::MDTuple::push_back(), replaceOperandWith(), and llvm::DILexicalBlockBase::replaceScope().
|
protected |
Definition at line 1055 of file Metadata.cpp.
References assert(), llvm::Metadata::Distinct, llvm::LLVMContextImpl::DistinctMDNodes, getContext(), llvm::Metadata::getMetadataID(), getNumUnresolved(), isResolved(), llvm_unreachable, llvm::LLVMContext::pImpl, and llvm::Metadata::Storage.
|
staticprotected |
Definition at line 28 of file MetadataImpl.h.
References llvm::Metadata::Distinct, llvm_unreachable, N, llvm::Metadata::Storage, llvm::Metadata::Temporary, and llvm::Metadata::Uniqued.
|
staticprotected |
Definition at line 42 of file MetadataImpl.h.
References llvm::Metadata::Distinct, N, llvm::Metadata::Storage, llvm::Metadata::Temporary, and llvm::Metadata::Uniqued.
|
friend |
Definition at line 1072 of file Metadata.h.
|
friend |
Definition at line 1071 of file Metadata.h.
|
friend |
Definition at line 1070 of file Metadata.h.