15#ifndef LLVM_IR_METADATA_H
16#define LLVM_IR_METADATA_H
44class ModuleSlotTracker;
46template <
typename T>
class StringMapEntry;
47template <
typename ValueTy>
class StringMapEntryStorage;
65 const unsigned char SubclassID;
80#define HANDLE_METADATA_LEAF(CLASS) CLASS##Kind,
81#include "llvm/IR/Metadata.def"
87 static_assert(
sizeof(*this) == 8,
"Metadata fields poorly packed");
124 bool IsForDebug =
false)
const;
126 bool IsForDebug =
false)
const;
138 const Module *M =
nullptr)
const;
147 return reinterpret_cast<Metadata**
>(MDs);
150#define HANDLE_METADATA(CLASS) class CLASS;
151#include "llvm/IR/Metadata.def"
155#define HANDLE_METADATA_LEAF(CLASS) \
156 template <> struct isa_impl<CLASS, Metadata> { \
157 static inline bool doit(const Metadata &MD) { \
158 return MD.getMetadataID() == Metadata::CLASS##Kind; \
161#include "llvm/IR/Metadata.def"
184 void dropUse() { MD =
nullptr; }
195 return V->getValueID() == MetadataAsValueVal;
199 void handleChangedMetadata(
Metadata *MD);
259 return retrack(&MD, *MD, &New);
295 assert(UseMap.
empty() &&
"Cannot destroy in-use replaceable metadata");
318 void dropRef(
void *
Ref);
319 void moveRef(
void *
Ref,
void *New,
const Metadata &MD);
333 static bool isReplaceable(
const Metadata &MD);
358 assert(V &&
"Expected valid value");
367 return cast<ConstantAsMetadata>(
get(
C));
371 return cast<LocalAsMetadata>(
get(Local));
377 return cast_or_null<ConstantAsMetadata>(
getIfExists(
C));
381 return cast_or_null<LocalAsMetadata>(
getIfExists(Local));
441 assert(!isa<Constant>(Local) &&
"Expected local value");
516 template <
class U,
class V>
521 sizeof(hasDereference<T, Result>(
nullptr)) ==
sizeof(
Yes);
524 static const bool value = std::is_base_of<Constant, V>::value &&
528 static const bool value = std::is_base_of<Constant, V>::value &&
529 std::is_convertible<M, const Metadata &>::value;
538template <
class X,
class Y>
539inline std::enable_if_t<detail::IsValidPointer<X, Y>::value,
bool>
541 assert(MD &&
"Null pointer sent into hasa");
542 if (
auto *V = dyn_cast<ConstantAsMetadata>(MD))
543 return isa<X>(V->getValue());
546template <
class X,
class Y>
547inline std::enable_if_t<detail::IsValidReference<X, Y &>::value,
bool>
555template <
class X,
class Y>
556inline std::enable_if_t<detail::IsValidPointer<X, Y>::value,
X *>
558 return cast<X>(cast<ConstantAsMetadata>(MD)->getValue());
560template <
class X,
class Y>
561inline std::enable_if_t<detail::IsValidReference<X, Y &>::value,
X *>
570template <
class X,
class Y>
571inline std::enable_if_t<detail::IsValidPointer<X, Y>::value,
X *>
573 if (
auto *V = cast_or_null<ConstantAsMetadata>(MD))
574 return cast<X>(V->getValue());
583template <
class X,
class Y>
584inline std::enable_if_t<detail::IsValidPointer<X, Y>::value,
X *>
586 if (
auto *V = dyn_cast<ConstantAsMetadata>(MD))
587 return dyn_cast<X>(V->getValue());
596template <
class X,
class Y>
597inline std::enable_if_t<detail::IsValidPointer<X, Y>::value,
X *>
599 if (
auto *V = dyn_cast_or_null<ConstantAsMetadata>(MD))
600 return dyn_cast<X>(V->getValue());
663 explicit operator bool()
const {
710 Result.Scope =
Scope;
725 Result.Scope =
Scope;
745 nullptr,
nullptr,
nullptr);
750 nullptr,
nullptr,
nullptr);
795 return isa<MDString>(this->
get()) &&
796 cast<MDString>(this->
get())->getString() == Str;
827 assert(
static_cast<void *
>(
this) == &MD &&
"Expected same address");
855 std::unique_ptr<ReplaceableMetadataImpl> ReplaceableUses)
871 return isa<ReplaceableMetadataImpl *>(
Ptr);
877 return *cast<LLVMContext *>(
Ptr);
882 return cast<ReplaceableMetadataImpl *>(
Ptr);
899 assert(ReplaceableUses &&
"Expected non-null replaceable uses");
901 "Expected same context");
903 Ptr = ReplaceableUses.release();
911 std::unique_ptr<ReplaceableMetadataImpl> ReplaceableUses(
913 Ptr = &ReplaceableUses->getContext();
914 return ReplaceableUses;
922#define HANDLE_MDNODE_LEAF(CLASS) \
923 using Temp##CLASS = std::unique_ptr<CLASS, TempMDNodeDeleter>;
924#define HANDLE_MDNODE_BRANCH(CLASS) HANDLE_MDNODE_LEAF(CLASS)
925#include "llvm/IR/Metadata.def"
962 struct alignas(alignof(size_t)) Header {
963 bool IsResizable : 1;
965 size_t SmallSize : 4;
966 size_t SmallNumOps : 4;
967 size_t :
sizeof(size_t) * CHAR_BIT - 10;
969 unsigned NumUnresolved = 0;
972 static constexpr size_t NumOpsFitInVector =
973 sizeof(LargeStorageVector) /
sizeof(
MDOperand);
975 NumOpsFitInVector *
sizeof(
MDOperand) ==
sizeof(LargeStorageVector),
976 "sizeof(LargeStorageVector) must be a multiple of sizeof(MDOperand)");
978 static constexpr size_t MaxSmallSize = 15;
980 static constexpr size_t getOpSize(
unsigned NumOps) {
985 static size_t getSmallSize(
size_t NumOps,
bool IsResizable,
bool IsLarge) {
986 return IsLarge ? NumOpsFitInVector
987 : std::max(NumOps, NumOpsFitInVector * IsResizable);
992 getSmallSize(NumOps, isResizable(
Storage), isLarge(NumOps))) +
998 static bool isLarge(
size_t NumOps) {
return NumOps > MaxSmallSize; }
1001 return getOpSize(SmallSize) +
sizeof(Header);
1003 void *getAllocation() {
1004 return reinterpret_cast<char *
>(
this + 1) -
1008 void *getLargePtr()
const {
1009 static_assert(
alignof(LargeStorageVector) <=
alignof(Header),
1010 "LargeStorageVector too strongly aligned");
1011 return reinterpret_cast<char *
>(
const_cast<Header *
>(
this)) -
1012 sizeof(LargeStorageVector);
1015 void *getSmallPtr();
1017 LargeStorageVector &getLarge() {
1019 return *
reinterpret_cast<LargeStorageVector *
>(getLargePtr());
1022 const LargeStorageVector &getLarge()
const {
1024 return *
reinterpret_cast<const LargeStorageVector *
>(getLargePtr());
1027 void resizeSmall(
size_t NumOps);
1028 void resizeSmallToLarge(
size_t NumOps);
1029 void resize(
size_t NumOps);
1034 MutableArrayRef<MDOperand> operands() {
1038 reinterpret_cast<MDOperand *
>(
this) - SmallSize, SmallNumOps);
1041 ArrayRef<MDOperand> operands()
const {
1044 return ArrayRef(
reinterpret_cast<const MDOperand *
>(
this) - SmallSize,
1048 unsigned getNumOperands()
const {
1051 return getLarge().size();
1055 Header &getHeader() {
return *(
reinterpret_cast<Header *
>(
this) - 1); }
1057 const Header &getHeader()
const {
1058 return *(
reinterpret_cast<const Header *
>(
this) - 1);
1061 ContextAndReplaceableUses Context;
1065 ArrayRef<Metadata *> Ops1, ArrayRef<Metadata *> Ops2 = std::nullopt);
1069 void operator delete(
void *Mem);
1095 void *
operator new(size_t) =
delete;
1106 TempMDNode
clone()
const;
1141 if (
Context.hasReplaceableUses())
1142 Context.getReplaceableUses()->replaceAllUsesWith(MD);
1161 static std::enable_if_t<std::is_base_of<MDNode, T>::value,
T *>
1163 return cast<T>(
N.release()->replaceWithPermanentImpl());
1173 static std::enable_if_t<std::is_base_of<MDNode, T>::value,
T *>
1175 return cast<T>(
N.release()->replaceWithUniquedImpl());
1183 static std::enable_if_t<std::is_base_of<MDNode, T>::value,
T *>
1185 return cast<T>(
N.release()->replaceWithDistinctImpl());
1197 const Module *M =
nullptr)
const;
1214 MDNode *replaceWithPermanentImpl();
1215 MDNode *replaceWithUniquedImpl();
1216 MDNode *replaceWithDistinctImpl();
1228 template <
class T,
class StoreT>
1237 assert(!
isUniqued() &&
"Resizing is not supported for uniqued nodes");
1239 "Resizing is not supported for this node kind");
1240 getHeader().resize(NumOps);
1244 void handleChangedOperand(
void *
Ref,
Metadata *New);
1247 void dropReplaceableUses();
1250 void decrementUnresolvedOperandCount();
1251 void countUnresolvedOperands();
1264 void makeDistinct();
1266 void deleteAsSubclass();
1268 void eraseFromStore();
1270 template <
class NodeTy>
struct HasCachedHash;
1271 template <
class NodeTy>
1272 static void dispatchRecalculateHash(NodeTy *
N, std::true_type) {
1273 N->recalculateHash();
1275 template <
class NodeTy>
1276 static void dispatchRecalculateHash(NodeTy *, std::false_type) {}
1277 template <
class NodeTy>
1278 static void dispatchResetHash(NodeTy *
N, std::true_type) {
1281 template <
class NodeTy>
1282 static void dispatchResetHash(NodeTy *, std::false_type) {}
1285 static MDNode *mergeDirectCallProfMetadata(MDNode *
A, MDNode *
B,
1286 const Instruction *AInstr,
1287 const Instruction *BInstr);
1305 return getHeader().operands()[
I];
1316#define HANDLE_MDNODE_LEAF(CLASS) \
1319#include "llvm/IR/Metadata.def"
1358 void recalculateHash();
1360 static MDTuple *
getImpl(LLVMContext &Context, ArrayRef<Metadata *> MDs,
1363 TempMDTuple cloneImpl()
const {
1399 TempMDTuple
clone()
const {
return cloneImpl(); }
1452 if (
Node->getNumOperands() < 2)
1454 return dyn_cast_or_null<MDNode>(
Node->getOperand(1));
1457 if (
Node->getNumOperands() > 2)
1458 if (
MDString *
N = dyn_cast_or_null<MDString>(
Node->getOperand(2)))
1459 return N->getString();
1512 std::enable_if_t<std::is_convertible<U *, T *>::value> * =
nullptr)
1518 std::enable_if_t<!std::is_convertible<U *, T *>::value> * =
nullptr)
1529 unsigned size()
const {
return N ?
N->getNumOperands() : 0u; }
1530 bool empty()
const {
return N ?
N->getNumOperands() == 0 :
true; }
1540#define HANDLE_METADATA(CLASS) \
1541 using CLASS##Array = MDTupleTypedArrayWrapper<CLASS>;
1542#include "llvm/IR/Metadata.def"
1592 assert(!
Use &&
"Use is still being tracked despite being untracked!");
1609 Module *Parent =
nullptr;
1612 void setParent(
Module *M) { Parent = M; }
1616 template <
class T1,
class T2>
class op_iterator_impl {
1625 using iterator_category = std::bidirectional_iterator_tag;
1626 using value_type = T2;
1627 using difference_type = std::ptrdiff_t;
1628 using pointer = value_type *;
1629 using reference = value_type &;
1631 op_iterator_impl() =
default;
1633 bool operator==(
const op_iterator_impl &o)
const {
return Idx == o.Idx; }
1634 bool operator!=(
const op_iterator_impl &o)
const {
return Idx !=
o.Idx; }
1636 op_iterator_impl &operator++() {
1641 op_iterator_impl operator++(
int) {
1642 op_iterator_impl tmp(*
this);
1653 op_iterator_impl tmp(*
this);
1684 bool IsForDebug =
false)
const;
BlockVerifier::State From
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref)
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
This file defines DenseMapInfo traits for DenseMap.
This file defines the DenseMap class.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static LazyValueInfoImpl & getImpl(void *&PImpl, AssumptionCache *AC, const Module *M)
This lazily constructs the LazyValueInfoImpl.
mir Rename Register Operands
Machine Check Debug Module
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
This file defines the PointerUnion class, which is a discriminated union of pointer types.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
bool operator==(const StringView &LHS, const StringView &RHS)
This is a simple wrapper around an MDNode which provides a higher-level interface by hiding the detai...
AliasScopeNode(const MDNode *N)
const MDNode * getNode() const
Get the MDNode for this AliasScopeNode.
const MDNode * getDomain() const
Get the MDNode for this AliasScopeNode's domain.
StringRef getName() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This is an important base class in LLVM.
Pointer to the context, with optional RAUW support.
ContextAndReplaceableUses & operator=(const ContextAndReplaceableUses &)=delete
ReplaceableMetadataImpl * getReplaceableUses() const
std::unique_ptr< ReplaceableMetadataImpl > takeReplaceableUses()
Drop RAUW support.
ContextAndReplaceableUses & operator=(ContextAndReplaceableUses &&)=delete
ReplaceableMetadataImpl * getOrCreateReplaceableUses()
Ensure that this has RAUW support, and then return it.
void makeReplaceable(std::unique_ptr< ReplaceableMetadataImpl > ReplaceableUses)
Assign RAUW support to this.
ContextAndReplaceableUses(ContextAndReplaceableUses &&)=delete
ContextAndReplaceableUses(const ContextAndReplaceableUses &)=delete
LLVMContext & getContext() const
~ContextAndReplaceableUses()
bool hasReplaceableUses() const
Whether this contains RAUW support.
ContextAndReplaceableUses()=delete
ContextAndReplaceableUses(LLVMContext &Context)
ContextAndReplaceableUses(std::unique_ptr< ReplaceableMetadataImpl > ReplaceableUses)
List of ValueAsMetadata, to be used as an argument to a dbg.value intrinsic.
Placeholder metadata for operands of distinct MDNodes.
void replaceUseWith(Metadata *MD)
Replace the use of this with MD.
DistinctMDOperandPlaceholder()=delete
~DistinctMDOperandPlaceholder()
DistinctMDOperandPlaceholder(const DistinctMDOperandPlaceholder &)=delete
DistinctMDOperandPlaceholder(unsigned ID)
DistinctMDOperandPlaceholder(DistinctMDOperandPlaceholder &&)=delete
This is an important class for using LLVM in a threaded context.
static MDNode * getMostGenericAliasScope(MDNode *A, MDNode *B)
void printTree(raw_ostream &OS, const Module *M=nullptr) const
Print in tree shape.
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
iterator_range< MDOperand * > mutable_op_range
void resolveCycles()
Resolve cycles.
bool isTBAAVtableAccess() const
Check whether MDNode is a vtable access.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
mutable_op_range mutable_operands()
void replaceAllUsesWith(Metadata *MD)
RAUW a temporary.
static MDNode * concatenate(MDNode *A, MDNode *B)
Methods for metadata merging.
static void deleteTemporary(MDNode *N)
Deallocate a node created by getTemporary.
void resolve()
Resolve a unique, unresolved node.
static MDNode * getMostGenericTBAA(MDNode *A, MDNode *B)
const MDOperand & getOperand(unsigned I) const
void storeDistinctInContext()
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
ArrayRef< MDOperand > operands() const
op_iterator op_end() const
MDNode(const MDNode &)=delete
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
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 MDNode * getMergedProfMetadata(MDNode *A, MDNode *B, const Instruction *AInstr, const Instruction *BInstr)
Merge !prof metadata from two instructions.
static bool classof(const Metadata *MD)
Methods for support type inquiry through isa, cast, and dyn_cast:
static MDNode * getMostGenericFPMath(MDNode *A, MDNode *B)
void setNumUnresolved(unsigned N)
void resize(size_t NumOps)
Resize the node to hold NumOps operands.
unsigned getNumOperands() const
Return number of MDNode operands.
MDOperand * mutable_begin()
TempMDNode clone() const
Create a (temporary) clone of this.
static MDNode * getMostGenericRange(MDNode *A, MDNode *B)
void setOperand(unsigned I, Metadata *New)
Set an operand.
MDNode(LLVMContext &Context, unsigned ID, StorageType Storage, ArrayRef< Metadata * > Ops1, ArrayRef< Metadata * > Ops2=std::nullopt)
bool isResolved() const
Check if node is fully resolved.
op_iterator op_begin() const
static MDNode * intersect(MDNode *A, MDNode *B)
static T * storeImpl(T *N, StorageType Storage, StoreT &Store)
LLVMContext & getContext() const
MDOperand * mutable_end()
static MDTuple * getIfExists(LLVMContext &Context, ArrayRef< Metadata * > MDs)
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.
void operator=(const MDNode &)=delete
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.
void dumpTree() const
User-friendly dump in tree shape.
static MDNode * getMostGenericAlignmentOrDereferenceable(MDNode *A, MDNode *B)
unsigned getNumUnresolved() const
Tracking metadata reference owned by Metadata.
bool equalsStr(StringRef Str) const
void reset(Metadata *MD, Metadata *Owner)
Metadata * operator->() const
MDOperand & operator=(const MDOperand &)=delete
Metadata & operator*() const
MDOperand(const MDOperand &)=delete
MDOperand & operator=(MDOperand &&Op)
MDOperand(MDOperand &&Op)
unsigned getLength() const
const unsigned char * bytes_begin() const
MDString(const MDString &)=delete
static MDString * get(LLVMContext &Context, const char *Str)
MDString & operator=(MDString &&)=delete
static bool classof(const Metadata *MD)
Methods for support type inquiry through isa, cast, and dyn_cast.
const unsigned char * bytes_end() const
iterator begin() const
Pointer to the first byte of the string.
MDString & operator=(const MDString &)=delete
StringRef getString() const
iterator end() const
Pointer to one byte past the end of the string.
static MDString * get(LLVMContext &Context, StringRef Str)
Typed, array-like tuple of metadata.
MDTupleTypedArrayWrapper(const MDTupleTypedArrayWrapper< U > &Other, std::enable_if_t<!std::is_convertible< U *, T * >::value > *=nullptr)
MDTupleTypedArrayWrapper()=default
MDTupleTypedArrayWrapper(const MDTuple *N)
T * operator[](unsigned I) const
MDTuple * operator->() const
MDTuple & operator*() const
MDTupleTypedArrayWrapper(const MDTupleTypedArrayWrapper< U > &Other, std::enable_if_t< std::is_convertible< U *, T * >::value > *=nullptr)
TypedMDOperandIterator< T > iterator
TempMDTuple clone() const
Return a (temporary) clone of this.
static MDTuple * getDistinct(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Return a distinct node.
static bool classof(const Metadata *MD)
void push_back(Metadata *MD)
Append an element to the tuple. This will resize the node.
unsigned getHash() const
Get the hash, if any.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static MDTuple * getIfExists(LLVMContext &Context, ArrayRef< Metadata * > MDs)
static TempMDTuple getTemporary(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Return a temporary node.
void pop_back()
Shrink the operands by 1.
Manage lifetime of a slot tracker for printing IR.
A Module instance is used to store all the information related to an LLVM module.
const_op_iterator op_begin() const
NamedMDNode(const NamedMDNode &)=delete
op_iterator_impl< MDNode *, MDNode > op_iterator
void setOperand(unsigned I, MDNode *New)
StringRef getName() const
void dropAllReferences()
Remove all uses and clear node vector.
void print(raw_ostream &ROS, bool IsForDebug=false) const
void eraseFromParent()
Drop all references and remove the node from parent module.
const_op_iterator op_end() const
iterator_range< const_op_iterator > operands() const
MDNode * getOperand(unsigned i) const
unsigned getNumOperands() const
const Module * getParent() const
void clearOperands()
Drop all references to this node's operands.
iterator_range< op_iterator > operands()
op_iterator_impl< const MDNode *, MDNode > const_op_iterator
Module * getParent()
Get the module that holds this named metadata collection.
void addOperand(MDNode *M)
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMapEntryStorage - Holds the value in a StringMapEntry.
StringMapEntry - This is used to represent one value that is inserted into a StringMap.
StringRef - Represent a constant reference to a string, i.e.
const unsigned char * bytes_end() const
constexpr size_t size() const
size - Get the string size.
const unsigned char * bytes_begin() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
The instances of the Type class are immutable: once they are created, they are never changed.
Typed iterator through MDNode operands.
TypedMDOperandIterator operator++(int)
std::ptrdiff_t difference_type
TypedMDOperandIterator()=default
std::input_iterator_tag iterator_category
bool operator==(const TypedMDOperandIterator &X) const
TypedMDOperandIterator & operator++()
TypedMDOperandIterator(MDNode::op_iterator I)
bool operator!=(const TypedMDOperandIterator &X) const
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
struct LLVMOpaqueNamedMDNode * LLVMNamedMDNodeRef
Represents an LLVM Named Metadata Node.
struct LLVMOpaqueMetadata * LLVMMetadataRef
Represents an LLVM Metadata.
This file defines the ilist_node class template, which is a convenient base class for creating classe...
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ArchKind & operator--(ArchKind &Kind)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
@ C
The default llvm calling convention, compatible with C.
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > dyn_extract_or_null(Y &&MD)
Extract a Value from Metadata, if any, allowing null.
std::enable_if_t< detail::IsValidPointer< X, Y >::value, bool > hasa(Y &&MD)
Check whether Metadata has a Value.
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > extract_or_null(Y &&MD)
Extract a Value from Metadata, allowing null.
std::enable_if_t< detail::IsValidPointer< X, Y >::value, X * > dyn_extract(Y &&MD)
Extract a Value from Metadata, if any.
This is an optimization pass for GlobalISel generic memory operations.
APInt operator*(APInt a, uint64_t RHS)
bool operator!=(uint64_t V1, const APInt &V2)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
@ Ref
The access may reference the value stored in memory.
Attribute unwrap(LLVMAttributeRef Attr)
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
ArrayRef(const T &OneElt) -> ArrayRef< T >
std::optional< APInt > getAllocSize(const CallBase *CB, const TargetLibraryInfo *TLI, function_ref< const Value *(const Value *)> Mapper=[](const Value *V) { return V;})
Return the size of the requested allocation.
const uint64_t NOMORE_ICP_MAGICNUM
Magic number in the value profile metadata showing a target has been promoted for the instruction and...
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
AAMDNodes concat(const AAMDNodes &Other) const
Determine the best AAMDNodes after concatenating two different locations together.
static MDNode * shiftTBAAStruct(MDNode *M, size_t off)
bool operator!=(const AAMDNodes &A) const
MDNode * TBAAStruct
The tag for type-based alias analysis (tbaa struct).
MDNode * Scope
The tag for alias scope specification (used with noalias).
static MDNode * extendToTBAA(MDNode *TBAA, ssize_t len)
MDNode * TBAA
The tag for type-based alias analysis.
AAMDNodes shift(size_t Offset) const
Create a new AAMDNode that describes this AAMDNode after applying a constant offset to the start of t...
AAMDNodes merge(const AAMDNodes &Other) const
Given two sets of AAMDNodes applying to potentially different locations, determine the best AAMDNodes...
MDNode * NoAlias
The tag specifying the noalias scope.
AAMDNodes intersect(const AAMDNodes &Other) const
Given two sets of AAMDNodes that apply to the same pointer, give the best AAMDNodes that are compatib...
AAMDNodes(MDNode *T, MDNode *TS, MDNode *S, MDNode *N)
AAMDNodes extendTo(ssize_t Len) const
Create a new AAMDNode that describes this AAMDNode after extending it to apply to a series of bytes o...
bool operator==(const AAMDNodes &A) const
static MDNode * shiftTBAA(MDNode *M, size_t off)
static AAMDNodes getEmptyKey()
static unsigned getHashValue(const AAMDNodes &Val)
static AAMDNodes getTombstoneKey()
static bool isEqual(const AAMDNodes &LHS, const AAMDNodes &RHS)
An information struct used to provide DenseMap with the various necessary components for a given valu...
void operator()(MDNode *Node) const
static No & hasDereference(...)
static Yes & hasDereference(SFINAE< sizeof(static_cast< V >(*make< U >()))> *=0)
static SimpleType getSimplifiedValue(MDOperand &MD)
static SimpleType getSimplifiedValue(const MDOperand &MD)
Define a template that can be specialized by smart pointers to reflect the fact that they are automat...