15 #ifndef LLVM_IR_MDBUILDER_H 16 #define LLVM_IR_MDBUILDER_H 27 template <
typename T>
class ArrayRef;
30 class ConstantAsMetadata;
156 Offset(Offset), Size(Size), Type(Type) {}
167 ArrayRef<std::pair<MDNode *, uint64_t>> Fields);
177 uint64_t
Offset,
bool IsConstant =
false);
190 uint64_t Offset, uint64_t Size,
191 bool IsImmutable =
false);
MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
static bool isConstant(const MachineInstr &MI)
MDNode * createAnonymousAARoot(StringRef Name=StringRef(), MDNode *Extra=nullptr)
Return metadata appropriate for a AA root node (scope or TBAA).
MDNode * createUnpredictable()
Return metadata specifying that a branch or switch is unpredictable.
This class represents lattice values for constants.
ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
MDNode * createAnonymousTBAARoot()
Return metadata appropriate for a TBAA root node.
Implements a dense probed hash-table based set.
MDNode * createAnonymousAliasScope(MDNode *Domain, StringRef Name=StringRef())
Return metadata appropriate for an alias scope root node.
MDBuilder(LLVMContext &context)
MDNode * createFPMath(float Accuracy)
Return metadata with the given settings.
MDNode * createIrrLoopHeaderWeight(uint64_t Weight)
Return metadata containing an irreducible loop header weight.
MDNode * createFunctionEntryCount(uint64_t Count, bool Synthetic, const DenseSet< GlobalValue::GUID > *Imports)
Return metadata containing the entry Count for a function, a boolean indicating whether the counts w...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
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.
This is an important class for using LLVM in a threaded context.
This is an important base class in LLVM.
MDNode * createAliasScopeDomain(StringRef Name)
Return metadata appropriate for an alias scope domain node with the given name.
MDNode * createTBAAStructNode(ArrayRef< TBAAStructField > Fields)
Return metadata for a tbaa.struct node with the given struct field descriptions.
MDNode * createBranchWeights(uint32_t TrueWeight, uint32_t FalseWeight)
Return metadata containing two branch weights.
MDNode * createAnonymousAliasScopeDomain(StringRef Name=StringRef())
Return metadata appropriate for an alias scope domain node.
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 t...
BaseType
A given derived pointer can have multiple base pointers through phi/selects.
Class for arbitrary precision integers.
TBAAStructField(uint64_t Offset, uint64_t Size, MDNode *Type)
MDNode * createCallees(ArrayRef< Function *> Callees)
Return metadata indicating the possible callees of indirect calls.
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...
MDString * createString(StringRef Str)
Return the given string as metadata.
MDNode * createAliasScope(StringRef Name, MDNode *Domain)
Return metadata appropriate for an alias scope node with the given name.
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 ...
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'.
MDNode * createFunctionSectionPrefix(StringRef Prefix)
Return metadata containing the section prefix for a function.
StringRef - Represent a constant reference to a string, i.e.
MDNode * createTBAARoot(StringRef Name)
Return metadata appropriate for a TBAA root node with the given name.
MDNode * createMutableTBAAAccessTag(MDNode *Tag)
Return mutable version of the given mutable or immutable TBAA access tag.
std::vector< uint32_t > Metadata
PAL metadata represented as a vector.