LLVM: llvm::MDBuilder Class Reference (original) (raw)

#include "[llvm/IR/MDBuilder.h](MDBuilder%5F8h%5Fsource.html)"

Public Member Functions
MDBuilder (LLVMContext &context)
LLVM_ABI MDString * createString (StringRef Str)
Return the given string as metadata.
LLVM_ABI ConstantAsMetadata * createConstant (Constant *C)
Return the given constant as metadata.
LLVM_ABI MDNode * createFPMath (float Accuracy)
Return metadata with the given settings.
LLVM_ABI MDNode * createBranchWeights (uint32_t TrueWeight, uint32_t FalseWeight, bool IsExpected=false)
Return metadata containing two branch weights.
LLVM_ABI MDNode * createLikelyBranchWeights ()
Return metadata containing two branch weights, with significant bias towards true destination.
LLVM_ABI MDNode * createUnlikelyBranchWeights ()
Return metadata containing two branch weights, with significant bias towards false destination.
LLVM_ABI MDNode * createBranchWeights (ArrayRef< uint32_t > Weights, bool IsExpected=false)
Return metadata containing a number of branch weights.
LLVM_ABI MDNode * createUnpredictable ()
Return metadata specifying that a branch or switch is unpredictable.
LLVM_ABI MDNode * createFunctionEntryCount (uint64_t Count, bool Synthetic, const DenseSet< GlobalValue::GUID > *Imports)
Return metadata containing the entry Count for a function, a boolean \Synthetic indicating whether the counts were synthetized, and the GUIDs stored in Imports that need to be imported for sample PGO, to enable the same inlines as the profiled optimized binary.
LLVM_ABI MDNode * createGlobalObjectSectionPrefix (StringRef Prefix)
Return metadata containing the section prefix for a global object.
LLVM_ABI MDNode * createPseudoProbeDesc (uint64_t GUID, uint64_t Hash, StringRef FName)
Return metadata containing the pseudo probe descriptor for a function.
LLVM_ABI MDNode * createLLVMStats (ArrayRef< std::pair< StringRef, uint64_t > > LLVMStatsVec)
Return metadata containing llvm statistics.
LLVM_ABI MDNode * createRange (const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
LLVM_ABI MDNode * createRange (Constant *Lo, Constant *Hi)
Return metadata describing the range [Lo, Hi).
LLVM_ABI MDNode * createCallees (ArrayRef< Function * > Callees)
Return metadata indicating the possible callees of indirect calls.
LLVM_ABI MDNode * createCallbackEncoding (unsigned CalleeArgNo, ArrayRef< int > Arguments, bool VarArgsArePassed)
Return metadata describing a callback (see llvm::AbstractCallSite).
LLVM_ABI MDNode * mergeCallbackEncodings (MDNode *ExistingCallbacks, MDNode *NewCB)
Merge the new callback encoding NewCB into ExistingCallbacks.
LLVM_ABI MDNode * createRTTIPointerPrologue (Constant *PrologueSig, Constant *RTTI)
Return metadata feeding to the CodeGen about how to generate a function prologue for the "function" santizier.
LLVM_ABI MDNode * createPCSections (ArrayRef< PCSection > Sections)
Return metadata for PC sections.
MDNode * createAnonymousTBAARoot ()
Return metadata appropriate for a TBAA root node.
MDNode * createAnonymousAliasScopeDomain (StringRef Name=StringRef())
Return metadata appropriate for an alias scope domain node.
MDNode * createAnonymousAliasScope (MDNode *Domain, StringRef Name=StringRef())
Return metadata appropriate for an alias scope root node.
LLVM_ABI MDNode * createTBAARoot (StringRef Name)
Return metadata appropriate for a TBAA root node with the given name.
LLVM_ABI MDNode * createAliasScopeDomain (StringRef Name)
Return metadata appropriate for an alias scope domain node with the given name.
LLVM_ABI MDNode * createAliasScope (StringRef Name, MDNode *Domain)
Return metadata appropriate for an alias scope node with the given name.
LLVM_ABI MDNode * createTBAANode (StringRef Name, MDNode *Parent, bool isConstant=false)
Return metadata for a non-root TBAA node with the given name, parent in the TBAA tree, and value for 'pointsToConstantMemory'.
LLVM_ABI MDNode * createTBAAStructNode (ArrayRef< TBAAStructField > Fields)
Return metadata for a tbaa.struct node with the given struct field descriptions.
LLVM_ABI MDNode * createTBAAStructTypeNode (StringRef Name, ArrayRef< std::pair< MDNode *, uint64_t > > Fields)
Return metadata for a TBAA struct node in the type DAG with the given name, a list of pairs (offset, field type in the type DAG).
LLVM_ABI MDNode * createTBAAScalarTypeNode (StringRef Name, MDNode *Parent, uint64_t Offset=0)
Return metadata for a TBAA scalar type node with the given name, an offset and a parent in the TBAA type DAG.
LLVM_ABI MDNode * createTBAAStructTagNode (MDNode *BaseType, MDNode *AccessType, uint64_t Offset, bool IsConstant=false)
Return metadata for a TBAA tag node with the given base type, access type and offset relative to the base type.
LLVM_ABI MDNode * createTBAATypeNode (MDNode *Parent, uint64_t Size, Metadata *Id, ArrayRef< TBAAStructField > Fields=ArrayRef< TBAAStructField >())
Return metadata for a TBAA type node in the TBAA type DAG with the given parent type, size in bytes, type identifier and a list of fields.
LLVM_ABI MDNode * createTBAAAccessTag (MDNode *BaseType, MDNode *AccessType, uint64_t Offset, uint64_t Size, bool IsImmutable=false)
Return metadata for a TBAA access tag with the given base type, final access type, offset of the access relative to the base type, size of the access and flag indicating whether the accessed object can be considered immutable for the purposes of the TBAA analysis.
LLVM_ABI MDNode * createMutableTBAAAccessTag (MDNode *Tag)
Return mutable version of the given mutable or immutable TBAA access tag.
LLVM_ABI MDNode * createIrrLoopHeaderWeight (uint64_t Weight)
Return metadata containing an irreducible loop header weight.

Definition at line 37 of file MDBuilder.h.

PCSection

A pair of PC section name with auxilliary constant data.

Definition at line 147 of file MDBuilder.h.

llvm::MDBuilder::MDBuilder ( LLVMContext & context) inline

createAliasScope()

Return metadata appropriate for an alias scope node with the given name.

This may be identified (uniqued) with other scopes with the same name and domain.

Definition at line 233 of file MDBuilder.cpp.

References createString(), and llvm::MDNode::get().

createAliasScopeDomain()

Return metadata appropriate for an alias scope domain node with the given name.

This may be identified (uniqued) with other roots with the same name.

Definition at line 229 of file MDBuilder.cpp.

References createString(), and llvm::MDNode::get().

createAnonymousAARoot()

createAnonymousAliasScope()

createAnonymousAliasScopeDomain()

createAnonymousTBAARoot()

MDNode * llvm::MDBuilder::createAnonymousTBAARoot ( ) inline

Return metadata appropriate for a TBAA root node.

Each returned node is distinct from all other metadata and will never be identified (uniqued) with anything else.

Definition at line 167 of file MDBuilder.h.

References createAnonymousAARoot().

createBranchWeights() [1/2]

createBranchWeights() [2/2]

Return metadata containing two branch weights.

Parameters

TrueWeight the weight of the true branch
FalseWeight the weight of the false branch
Do these weights come from __builtin_expect*

Definition at line 38 of file MDBuilder.cpp.

References createBranchWeights().

Referenced by llvm::VPlanTransforms::addBranchWeightToMiddleTerminator(), llvm::VPlanTransforms::addMinimumIterationCheck(), llvm::VPlanTransforms::addMinimumVectorEpilogueIterationCheck(), llvm::VPlanTransforms::attachCheckBlock(), CloneLoopBlocks(), ConnectEpilog(), ConnectProlog(), llvm::ConstantFoldTerminator(), createBranchWeights(), createBranchWeights(), llvm::createCallMatchingInvoke(), createLikelyBranchWeights(), createUnlikelyBranchWeights(), handleBrSelExpect(), handlePhiDef(), InsertStackProtectors(), llvm::makeGuardControlFlowExplicit(), llvm::setBranchWeights(), simplifySwitchOfCmpIntrinsic(), and llvm::UnrollRuntimeLoopRemainder().

createCallbackEncoding()

createCallees()

createConstant()

Return the given constant as metadata.

Definition at line 25 of file MDBuilder.cpp.

References llvm::CallingConv::C, and llvm::ConstantAsMetadata::get().

Referenced by addModuleFlags(), llvm::annotateValueSite(), createBranchWeights(), createCallbackEncoding(), createCallees(), createFPMath(), createFunctionEntryCount(), createIrrLoopHeaderWeight(), createLLVMStats(), createPCSections(), createPseudoProbeDesc(), createRange(), createRTTIPointerPrologue(), createTBAAAccessTag(), createTBAANode(), createTBAAScalarTypeNode(), createTBAAStructNode(), createTBAAStructTagNode(), createTBAAStructTypeNode(), createTBAATypeNode(), lowerKernelArguments(), llvm::scaleProfData(), llvm::setKCFIType(), and translateBranchMetadata().

createFPMath()

createFunctionEntryCount()

Return metadata containing the entry Count for a function, a boolean \Synthetic indicating whether the counts were synthetized, and the GUIDs stored in Imports that need to be imported for sample PGO, to enable the same inlines as the profiled optimized binary.

Definition at line 72 of file MDBuilder.cpp.

References AbstractManglingParser< Derived, Alloc >::Ops, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::begin(), llvm::Count, createConstant(), createString(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::end(), llvm::MDProfLabels::FunctionEntryCount, llvm::MDNode::get(), llvm::Type::getInt64Ty(), llvm::sort(), and llvm::MDProfLabels::SyntheticFunctionEntryCount.

createGlobalObjectSectionPrefix()

createIrrLoopHeaderWeight()

createLikelyBranchWeights()

MDNode * MDBuilder::createLikelyBranchWeights ( )

createLLVMStats()

createMutableTBAAAccessTag()

MDNode * MDBuilder::createMutableTBAAAccessTag ( MDNode * Tag )

createPCSections()

Return metadata for PC sections.

Definition at line 174 of file MDBuilder.cpp.

References AbstractManglingParser< Derived, Alloc >::Ops, llvm::CallingConv::C, createConstant(), createString(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::MDNode::get(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

createPseudoProbeDesc()

createRange() [1/2]

Return metadata describing the range [Lo, Hi).

Definition at line 96 of file MDBuilder.cpp.

References assert(), createRange(), llvm::IntegerType::get(), llvm::Hi, and llvm::Lo.

Referenced by annotateGridSizeLoadWithRangeMD(), llvm::copyNonnullMetadata(), createRange(), llvm::SITargetLowering::emitExpandAtomicAddrSpacePredicate(), lowerKernelArguments(), llvm::AMDGPUSubtarget::makeLIDRangeMetadata(), and upgradeAMDGCNIntrinsicCall().

createRange() [2/2]

createRTTIPointerPrologue()

createString()

Return the given string as metadata.

Definition at line 21 of file MDBuilder.cpp.

References llvm::MDString::get().

Referenced by llvm::Instruction::addAnnotationMetadata(), llvm::Instruction::addAnnotationMetadata(), annotateFunctionWithHashMismatch(), llvm::annotateValueSite(), createAliasScope(), createAliasScopeDomain(), createAnonymousAARoot(), createBranchWeights(), createFunctionEntryCount(), createGlobalObjectSectionPrefix(), createIrrLoopHeaderWeight(), createLLVMStats(), createPCSections(), createPseudoProbeDesc(), createTBAANode(), createTBAARoot(), createTBAAScalarTypeNode(), createTBAAStructTypeNode(), and translateBranchMetadata().

createTBAAAccessTag()

createTBAANode()

createTBAARoot()

createTBAAScalarTypeNode()

createTBAAStructNode()

createTBAAStructTagNode()

createTBAAStructTypeNode()

createTBAATypeNode()

Return metadata for a TBAA type node in the TBAA type DAG with the given parent type, size in bytes, type identifier and a list of fields.

Definition at line 286 of file MDBuilder.cpp.

References AbstractManglingParser< Derived, Alloc >::Ops, createConstant(), llvm::MDNode::get(), llvm::Type::getInt64Ty(), I, llvm::Offset, Size, and llvm::ArrayRef< T >::size().

createUnlikelyBranchWeights()

MDNode * MDBuilder::createUnlikelyBranchWeights ( )

createUnpredictable()

MDNode * MDBuilder::createUnpredictable ( )

mergeCallbackEncodings()


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