1//===- TypeBasedAliasAnalysis.cpp - Type-Based Alias Analysis -------------===// 3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4// See https://llvm.org/LICENSE.txt for license information. 5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7//===----------------------------------------------------------------------===// 9// This file defines the TypeBasedAliasAnalysis pass, which implements 10// metadata-based TBAA. 12// In LLVM IR, memory does not have types, so LLVM's own type system is not 13// suitable for doing TBAA. Instead, metadata is added to the IR to describe 14// a type system of a higher level language. This can be used to implement 15// typical C/C++ TBAA, but it can also be used to implement custom alias 16// analysis behavior for other languages. 18// We now support two types of metadata format: scalar TBAA and struct-path 19// aware TBAA. After all testing cases are upgraded to use struct-path aware 20// TBAA and we can auto-upgrade existing bc files, the support for scalar TBAA 23// The scalar TBAA metadata format is very simple. TBAA MDNodes have up to 25// !0 = !{ !"an example type tree" } 26// !1 = !{ !"int", !0 } 27// !2 = !{ !"float", !0 } 28// !3 = !{ !"const float", !2, i64 1 } 30// The first field is an identity field. It can be any value, usually 31// an MDString, which uniquely identifies the type. The most important 32// name in the tree is the name of the root node. Two trees with 33// different root node names are entirely disjoint, even if they 34// have leaves with common names. 36// The second field identifies the type's parent node in the tree, or 37// is null or omitted for a root node. A type is considered to alias 38// all of its descendants and all of its ancestors in the tree. Also, 39// a type is considered to alias all types in other trees, so that 40// bitcode produced from multiple front-ends is handled conservatively. 42// If the third field is present, it's an integer which if equal to 1 43// indicates that the type is "constant" (meaning pointsToConstantMemory 44// should return true; see 45// http://llvm.org/docs/AliasAnalysis.html#OtherItfs). 47// With struct-path aware TBAA, the MDNodes attached to an instruction using 48// "!tbaa" are called path tag nodes. 50// The path tag node has 4 fields with the last field being optional. 52// The first field is the base type node, it can be a struct type node 53// or a scalar type node. The second field is the access type node, it 54// must be a scalar type node. The third field is the offset into the base type. 55// The last field has the same meaning as the last field of our scalar TBAA: 56// it's an integer which if equal to 1 indicates that the access is "constant". 58// The struct type node has a name and a list of pairs, one pair for each member 59// of the struct. The first element of each pair is a type node (a struct type 60// node or a scalar type node), specifying the type of the member, the second 61// element of each pair is the offset of the member. 72// For an access to B.a.s, we attach !5 (a path tag node) to the load/store 73// instruction. The base type is !4 (struct B), the access type is !2 (scalar 74// type short) and the offset is 4. 76// !0 = !{!"Simple C/C++ TBAA"} 77// !1 = !{!"omnipotent char", !0} // Scalar type node 78// !2 = !{!"short", !1} // Scalar type node 79// !3 = !{!"A", !2, i64 0} // Struct type node 80// !4 = !{!"B", !2, i64 0, !3, i64 4} 82// !5 = !{!4, !2, i64 4} // Path tag node 84// The struct type nodes and the scalar type nodes form a type DAG. 86// char (!1) -- edge to Root 87// short (!2) -- edge to char 88// A (!3) -- edge with offset 0 to short 89// B (!4) -- edge with offset 0 to short and edge with offset 4 to A 91// To check if two tags (tagX and tagY) can alias, we start from the base type 92// of tagX, follow the edge with the correct offset in the type DAG and adjust 93// the offset until we reach the base type of tagY or until we reach the Root 95// If we reach the base type of tagY, compare the adjusted offset with 96// offset of tagY, return Alias if the offsets are the same, return NoAlias 98// If we reach the Root node, perform the above starting from base type of tagY 99// to see if we reach base type of tagX. 101// If they have different roots, they're part of different potentially 102// unrelated type systems, so we return Alias to be conservative. 103// If neither node is an ancestor of the other and they have the same root, 104// then we say NoAlias. 106//===----------------------------------------------------------------------===// 128// A handy option for disabling TBAA functionality. The same effect can also be 129// achieved by stripping the !tbaa tags from IR, but this option is sometimes 135/// isNewFormatTypeNode - Return true iff the given type node is in the new 136/// size-aware format. 137staticbool isNewFormatTypeNode(
constMDNode *
N) {
138if (
N->getNumOperands() < 3)
140// In the old format the first operand is a string. 141if (!isa<MDNode>(
N->getOperand(0)))
146/// This is a simple wrapper around an MDNode which provides a higher-level 147/// interface by hiding the details of how alias analysis information is encoded 149template<
typename MDNodeTy>
151 MDNodeTy *
Node =
nullptr;
154 TBAANodeImpl() =
default;
155explicit TBAANodeImpl(MDNodeTy *
N) :
Node(
N) {}
157 /// getNode - Get the MDNode for this TBAANode. 160 /// isNewFormat - Return true iff the wrapped type node is in the new 161 /// size-aware format. 162bool isNewFormat()
const{
return isNewFormatTypeNode(
Node); }
164 /// getParent - Get this TBAANode's Alias tree parent. 167return TBAANodeImpl(cast<MDNodeTy>(
Node->getOperand(0)));
169if (
Node->getNumOperands() < 2)
170return TBAANodeImpl<MDNodeTy>();
171 MDNodeTy *
P = dyn_cast_or_null<MDNodeTy>(
Node->getOperand(1));
173return TBAANodeImpl<MDNodeTy>();
174// Ok, this node has a valid parent. Return it. 175return TBAANodeImpl<MDNodeTy>(
P);
178 /// Test if this TBAANode represents a type for objects which are 179 /// not modified (by any means) in the context where this 180 /// AliasAnalysis is relevant. 181bool isTypeImmutable()
const{
182if (
Node->getNumOperands() < 3)
184ConstantInt *CI = mdconst::dyn_extract<ConstantInt>(
Node->getOperand(2));
191/// \name Specializations of \c TBAANodeImpl for const and non const qualified 194usingTBAANode = TBAANodeImpl<const MDNode>;
195usingMutableTBAANode = TBAANodeImpl<MDNode>;
198/// This is a simple wrapper around an MDNode which provides a 199/// higher-level interface by hiding the details of how alias analysis 200/// information is encoded in its operands. 201template<
typename MDNodeTy>
202classTBAAStructTagNodeImpl {
203 /// This node should be created with createTBAAAccessTag(). 207explicit TBAAStructTagNodeImpl(MDNodeTy *
N) :
Node(
N) {}
209 /// Get the MDNode for this TBAAStructTagNode. 212 /// isNewFormat - Return true iff the wrapped access tag is in the new 213 /// size-aware format. 214bool isNewFormat()
const{
215if (
Node->getNumOperands() < 4)
218if (!TBAANodeImpl<MDNodeTy>(AccessType).isNewFormat())
224return dyn_cast_or_null<MDNode>(
Node->getOperand(0));
228return dyn_cast_or_null<MDNode>(
Node->getOperand(1));
232return mdconst::extract<ConstantInt>(
Node->getOperand(2))->getZExtValue();
238return mdconst::extract<ConstantInt>(
Node->getOperand(3))->getZExtValue();
241 /// Test if this TBAAStructTagNode represents a type for objects 242 /// which are not modified (by any means) in the context where this 243 /// AliasAnalysis is relevant. 244bool isTypeImmutable()
const{
245unsigned OpNo = isNewFormat() ? 4 : 3;
246if (
Node->getNumOperands() < OpNo + 1)
248ConstantInt *CI = mdconst::dyn_extract<ConstantInt>(
Node->getOperand(OpNo));
255/// \name Specializations of \c TBAAStructTagNodeImpl for const and non const 256/// qualified \c MDNods. 258usingTBAAStructTagNode = TBAAStructTagNodeImpl<const MDNode>;
259usingMutableTBAAStructTagNode = TBAAStructTagNodeImpl<MDNode>;
262/// This is a simple wrapper around an MDNode which provides a 263/// higher-level interface by hiding the details of how alias analysis 264/// information is encoded in its operands. 265classTBAAStructTypeNode {
266 /// This node should be created with createTBAATypeNode(). 270 TBAAStructTypeNode() =
default;
273 /// Get the MDNode for this TBAAStructTypeNode. 276 /// isNewFormat - Return true iff the wrapped type node is in the new 277 /// size-aware format. 278bool isNewFormat()
const{
return isNewFormatTypeNode(
Node); }
284 /// getId - Return type identifier. 286returnNode->getOperand(isNewFormat() ? 2 : 0);
289unsigned getNumFields()
const{
290unsigned FirstFieldOpNo = isNewFormat() ? 3 : 1;
291unsigned NumOpsPerField = isNewFormat() ? 3 : 2;
292return (
getNode()->getNumOperands() - FirstFieldOpNo) / NumOpsPerField;
295 TBAAStructTypeNode getFieldType(
unsigned FieldIndex)
const{
296unsigned FirstFieldOpNo = isNewFormat() ? 3 : 1;
297unsigned NumOpsPerField = isNewFormat() ? 3 : 2;
298unsignedOpIndex = FirstFieldOpNo + FieldIndex * NumOpsPerField;
300return TBAAStructTypeNode(TypeNode);
303 /// Get this TBAAStructTypeNode's field in the type DAG with 304 /// given offset. Update the offset to be relative to the field type. 306bool NewFormat = isNewFormat();
308constunsigned NumOperands =
Operands.size();
311// New-format root and scalar type nodes have no fields. 313return TBAAStructTypeNode();
315// Parent can be omitted for the root node. 317return TBAAStructTypeNode();
319// Fast path for a scalar type node and a struct type node with a single 321if (NumOperands <= 3) {
325 : mdconst::extract<ConstantInt>(
Operands[2])->getZExtValue();
329return TBAAStructTypeNode();
330return TBAAStructTypeNode(
P);
334// Assume the offsets are in order. We return the previous field if 335// the current offset is bigger than the given offset. 336unsigned FirstFieldOpNo = NewFormat ? 3 : 1;
337unsigned NumOpsPerField = NewFormat ? 3 : 2;
340for (
unsignedIdx = FirstFieldOpNo;
Idx < NumOperands;
341Idx += NumOpsPerField) {
343 mdconst::extract<ConstantInt>(
Operands[
Idx + 1])->getZExtValue();
345assert(
Idx >= FirstFieldOpNo + NumOpsPerField &&
346"TBAAStructTypeNode::getField should have an offset match!");
347 TheIdx =
Idx - NumOpsPerField;
351// Move along the last field. 353 TheIdx = NumOperands - NumOpsPerField;
355 mdconst::extract<ConstantInt>(
Operands[TheIdx + 1])->getZExtValue();
359return TBAAStructTypeNode();
360return TBAAStructTypeNode(
P);
364}
// end anonymous namespace 366/// Check the first operand of the tbaa tag node, if it is a MDNode, we treat 367/// it as struct-path aware TBAA format, otherwise, we treat it as scalar TBAA 370// Anonymous TBAA root starts with a MDNode and dragonegg uses it as 384// Otherwise return a definitive result. 398// If this is an "immutable" type, we can assume the pointer is pointing 399// to constant memory. 412// If this is an "immutable" type, the access is not observable. 413if (
constMDNode *M = Call->getMetadata(LLVMContext::MD_tbaa))
422// Functions don't have metadata. 433if (
constMDNode *M = Call->getMetadata(LLVMContext::MD_tbaa))
459if (Tag1->getString() ==
"vtable pointer")
465// For struct-path aware TBAA, we use the access type of the tag. 466 TBAAStructTagNode
Tag(
this);
467 TBAAStructTypeNode AccessType(
Tag.getAccessType());
468if(
auto *Id = dyn_cast<MDString>(AccessType.getId()))
469if (Id->getString() ==
"vtable pointer")
475constMDNode **GenericTag =
nullptr);
480returnconst_cast<MDNode*
>(GenericTag);
492while (TA.getNode()) {
493if (!PathA.
insert(TA.getNode()))
500while (TB.getNode()) {
501if (!PathB.
insert(TB.getNode()))
506int IA = PathA.
size() - 1;
507int IB = PathB.
size() - 1;
510while (IA >= 0 && IB >= 0) {
511if (PathA[IA] == PathB[IB])
525 Result.TBAAStruct =
nullptr;
533 Result.TBAA = Result.TBAAStruct =
nullptr;
540// If there is no access type or the access type is the root node, then 541// we don't have any useful access tag to return. 548if (TBAAStructTypeNode(AccessType).isNewFormat()) {
549// TODO: Take access ranges into account when matching access tags and 550// fix this code to generate actual access sizes for generic tags. 555const_cast<MDNode*
>(AccessType),
556 OffsetNode, SizeNode};
561const_cast<MDNode*
>(AccessType),
567 TBAAStructTypeNode FieldType) {
568for (
unsignedI = 0, E =
BaseType.getNumFields();
I != E; ++
I) {
569 TBAAStructTypeNode
T =
BaseType.getFieldType(
I);
576/// Return true if for two given accesses, one of the accessed objects may be a 577/// subobject of the other. The \p BaseTag and \p SubobjectTag parameters 578/// describe the accesses to the base object and the subobject respectively. 579/// \p CommonType must be the metadata node describing the common type of the 580/// accessed objects. On return, \p MayAlias is set to true iff these accesses 581/// may alias and \p Generic, if not null, points to the most generic access 582/// tag for the given two. 584 TBAAStructTagNode SubobjectTag,
588// If the base object is of the least common type, then this may be an access 590if (BaseTag.getAccessType() == BaseTag.getBaseType() &&
591 BaseTag.getAccessType() == CommonType) {
598// If the access to the base object is through a field of the subobject's 599// type, then this may be an access to that field. To check for that we start 600// from the base type, follow the edge with the correct offset in the type DAG 601// and adjust the offset until we reach the field type or until we reach the 603bool NewFormat = BaseTag.isNewFormat();
604 TBAAStructTypeNode
BaseType(BaseTag.getBaseType());
605uint64_t OffsetInBase = BaseTag.getOffset();
608// In the old format there is no distinction between fields and parent 609// types, so in this case we consider all nodes up to the root. 611assert(!NewFormat &&
"Did not see access type in access path!");
615if (
BaseType.getNode() == SubobjectTag.getBaseType()) {
616 MayAlias = OffsetInBase == SubobjectTag.getOffset() ||
617BaseType.getNode() == BaseTag.getAccessType() ||
618 SubobjectTag.getBaseType() == SubobjectTag.getAccessType();
626// With new-format nodes we stop at the access type. 627if (NewFormat &&
BaseType.getNode() == BaseTag.getAccessType())
630// Follow the edge with the correct offset. Offset will be adjusted to 631// be relative to the field type. 635// If the base object has a direct or indirect field of the subobject's type, 636// then this may be an access to that field. We need this to check now that 637// we support aggregates as access types. 639// TBAAStructTypeNode BaseAccessType(BaseTag.getAccessType()); 640 TBAAStructTypeNode FieldType(SubobjectTag.getBaseType());
652/// matchTags - Return true if the given couple of accesses are allowed to 653/// overlap. If \arg GenericTag is not null, then on return it points to the 654/// most generic access descriptor for the given two. 656constMDNode **GenericTag) {
663// Accesses with no TBAA information may alias with any other accesses. 666 *GenericTag =
nullptr;
670// Verify that both input nodes are struct-path aware. Auto-upgrade should 671// have taken care of this. 675 TBAAStructTagNode TagA(
A), TagB(
B);
677 TagB.getAccessType());
679// If the final access types have different roots, they're part of different 680// potentially unrelated type systems, so we must be conservative. 683 *GenericTag =
nullptr;
687// If one of the accessed objects may be a subobject of the other, then such 688// accesses may alias. 691 CommonType, GenericTag, MayAlias) ||
693 CommonType, GenericTag, MayAlias))
696// Otherwise, we've proved there's no alias. 702/// Aliases - Test whether the access represented by tag A may alias the 703/// access represented by tag B. 704bool TypeBasedAAResult::Aliases(
constMDNode *
A,
constMDNode *
B)
const{
708bool TypeBasedAAResult::shouldUseTBAA()
const{
745// Fast path if there's no offset 748// Fast path if there's no path tbaa node (and thus scalar) 752// The correct behavior here is to add the offset into the TBAA 753// struct node offset. The base type, however may not have defined 754// a type at this additional offset, resulting in errors. Since 755// this method is only used within a given load/store access 756// the offset provided is only used to subdivide the previous load 757// maintaining the validity of the previous TBAA. 759// This, however, should be revisited in the future. 764// Fast path if there's no offset 771 mdconst::extract<ConstantInt>(MD->
getOperand(i + 1));
772// Don't include any triples that aren't in bounds 783// Shift the offset of the triple 785 ConstantInt::get(InnerOffset->
getType(), NewOffset)));
787 ConstantInt::get(InnerSize->
getType(), NewSize)));
794// Fast path if 0-length 798// Regular TBAA is invariant of length, so we only need to consider 803 TBAAStructTagNode
Tag(MD);
805// Only new format TBAA has a size 806if (!
Tag.isNewFormat())
809// If unknown size, drop the TBAA. 813// Otherwise, create TBAA with the new Len 816ConstantInt *PreviousSize = mdconst::extract<ConstantInt>(NextNodes[3]);
818// Don't create a new MDNode if it is the same length. 829MDNode *M = New.TBAAStruct;
830if (!New.TBAA && M && M->getNumOperands() >= 3 && M->getOperand(0) &&
831 mdconst::hasa<ConstantInt>(M->getOperand(0)) &&
832 mdconst::extract<ConstantInt>(M->getOperand(0))->isZero() &&
833 M->getOperand(1) && mdconst::hasa<ConstantInt>(M->getOperand(1)) &&
834 mdconst::extract<ConstantInt>(M->getOperand(1))->getValue() ==
836 M->getOperand(2) && isa<MDNode>(M->getOperand(2)))
837 New.TBAA = cast<MDNode>(M->getOperand(2));
839 New.TBAAStruct =
nullptr;
846if (!
DL.typeSizeEqualsStoreSize(AccessTy))
849if (
Size.isScalable())
852return New.adjustForAccess(
Size.getKnownMinValue());
857return New.adjustForAccess(AccessSize);
static msgpack::DocNode getNode(msgpack::DocNode DN, msgpack::Type Type, MCValue Val)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static const Function * getParent(const Value *V)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
This file contains the declarations for the subclasses of Constant, which represent the different fla...
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
std::optional< std::vector< StOtherPiece > > Other
static MemAccessTy getAccessType(const TargetTransformInfo &TTI, Instruction *Inst, Value *OperandVal)
Return the type of the memory being accessed.
mir Rename Register Operands
This file provides utility analysis objects describing memory locations.
This file contains the declarations for metadata subclasses.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static enum BaseType getBaseType(const Value *Val)
Return the baseType for Val which states whether Val is exclusively derived from constant/null,...
This file implements a set that has insertion order iteration characteristics.
static bool matchAccessTags(const MDNode *A, const MDNode *B, const MDNode **GenericTag=nullptr)
matchTags - Return true if the given couple of accesses are allowed to overlap.
static cl::opt< bool > EnableTBAA("enable-tbaa", cl::init(true), cl::Hidden)
static bool isStructPathTBAA(const MDNode *MD)
Check the first operand of the tbaa tag node, if it is a MDNode, we treat it as struct-path aware TBA...
static bool mayBeAccessToSubobjectOf(TBAAStructTagNode BaseTag, TBAAStructTagNode SubobjectTag, const MDNode *CommonType, const MDNode **GenericTag, bool &MayAlias)
Return true if for two given accesses, one of the accessed objects may be a subobject of the other.
static bool hasField(TBAAStructTypeNode BaseType, TBAAStructTypeNode FieldType)
static const MDNode * createAccessTag(const MDNode *AccessType)
static const MDNode * getLeastCommonType(const MDNode *A, const MDNode *B)
This is the interface for a metadata-based TBAA.
static unsigned getSize(unsigned Kind)
This class stores info we want to provide to or retain within an alias query.
The possible results of an alias query.
@ MayAlias
The two locations may or may not alias.
@ NoAlias
The two locations do not alias at all.
A container for analyses that lazily runs them and caches their results.
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
static ConstantAsMetadata * get(Constant *C)
This is the shared class of boolean and integer constants.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
bool equalsInt(uint64_t V) const
A helper method that can be used to determine if the constant contained within is equal to a constant...
const APInt & getValue() const
Return the constant as an APInt value reference.
A parsed version of the target data layout string in and methods for querying it.
ImmutablePass class - This class is used to provide information that does not need to be run.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
static MDNode * getMostGenericAliasScope(MDNode *A, MDNode *B)
bool isTBAAVtableAccess() const
Check whether MDNode is a vtable access.
static MDNode * getMostGenericTBAA(MDNode *A, MDNode *B)
const MDOperand & getOperand(unsigned I) const
ArrayRef< MDOperand > operands() const
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
unsigned getNumOperands() const
Return number of MDNode operands.
static MDNode * intersect(MDNode *A, MDNode *B)
LLVMContext & getContext() const
static MemoryEffectsBase none()
Create MemoryEffectsBase that cannot read or write any memory.
static MemoryEffectsBase unknown()
Create MemoryEffectsBase that can read and write any memory.
Representation for a specific memory location.
AAMDNodes AATags
The metadata nodes which describes the aliasing of the location (each member is null if that kind of ...
Root of the metadata hierarchy.
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
size_type size() const
Determine the number of elements in the SetVector.
bool insert(const value_type &X)
Insert a new element into the SetVector.
A SetVector that performs no allocations if smaller than a certain size.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
A simple AA result that uses TBAA metadata to answer queries.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB, AAQueryInfo &AAQI, const Instruction *CtxI)
ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, AAQueryInfo &AAQI, bool IgnoreLocals)
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc, AAQueryInfo &AAQI)
MemoryEffects getMemoryEffects(const CallBase *Call, AAQueryInfo &AAQI)
Legacy wrapper pass to provide the TypeBasedAAResult object.
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
TypeBasedAAResult run(Function &F, FunctionAnalysisManager &AM)
The instances of the Type class are immutable: once they are created, they are never changed.
Type * getType() const
All values are typed, get the type of this value.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
void initializeTypeBasedAAWrapperPassPass(PassRegistry &)
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
unsigned M1(unsigned Val)
static Error getOffset(const SymbolRef &Sym, SectionRef Sec, uint64_t &Result)
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
@ ModRef
The access may reference and may modify the value stored in memory.
@ NoModRef
The access neither references nor modifies the value stored in memory.
ImmutablePass * createTypeBasedAAWrapperPass()
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)
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 adjustForAccess(unsigned AccessSize)
Create a new AAMDNode for accessing AccessSize bytes of this AAMDNode.
static MDNode * shiftTBAA(MDNode *M, size_t off)
A special type used by analysis passes to provide an address that identifies that particular analysis...