1//==- AliasAnalysis.cpp - Generic Alias Analysis Interface Implementation --==// 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 implements the generic AliasAnalysis interface which is used as the 10// common interface used by all clients and implementations of alias analysis. 12// This file also implements the default version of the AliasAnalysis interface 13// that is to be used when no other implementation is specified. This does some 14// simple tests that detect obvious cases: two different global pointers cannot 15// alias, a global cannot alias a malloc, two different mallocs cannot alias, 18// This alias analysis implementation really isn't very good for anything, but 19// it is very fast, and makes a nice clean default implementation. Because it 20// handles lots of little corner cases, other, more complex, alias analysis 21// implementations may choose to rely on this pass to resolve these simple and 24//===----------------------------------------------------------------------===// 53#define DEBUG_TYPE "aa" 59STATISTIC(NumMustAlias,
"Number of MustAlias results");
62/// Allow disabling BasicAA from the AA results. This is particularly useful 63/// when testing to isolate a single AA implementation. 68/// Print a trace of alias analysis queries and their results. 77 : TLI(Arg.TLI), AAs(
std::
move(Arg.AAs)), AADeps(
std::
move(Arg.AADeps)) {}
83// AAResults preserves the AAManager by default, due to the stateless nature 84// of AliasAnalysis. There is no need to check whether it has been preserved 85// explicitly. Check if any module dependency was invalidated and caused the 86// AAManager to be invalidated. Invalidate ourselves in that case. 88if (!PAC.preservedWhenStateless())
91// Check if any of the function dependencies were invalidated, and invalidate 92// ourselves in that case. 97// Everything we depend on is still fine, so are we. Nothing to invalidate. 101//===----------------------------------------------------------------------===// 102// Default chaining methods 103//===----------------------------------------------------------------------===// 108returnalias(LocA, LocB, AAQIP,
nullptr);
117for (
unsignedI = 0;
I < AAQI.
Depth; ++
I)
119dbgs() <<
"Start " << *LocA.
Ptr <<
" @ " << LocA.
Size <<
", " 120 << *LocB.
Ptr <<
" @ " << LocB.
Size <<
"\n";
124for (
constauto &AA : AAs) {
125 Result = AA->alias(LocA, LocB, AAQI, CtxI);
132for (
unsignedI = 0;
I < AAQI.
Depth; ++
I)
134dbgs() <<
"End " << *LocA.
Ptr <<
" @ " << LocA.
Size <<
", " 135 << *LocB.
Ptr <<
" @ " << LocB.
Size <<
" = " << Result <<
"\n";
138if (AAQI.
Depth == 0) {
159for (
constauto &AA : AAs) {
160 Result &= AA->getModRefInfoMask(Loc, AAQI, IgnoreLocals);
162// Early-exit the moment we reach the bottom of the lattice. 173for (
constauto &AA : AAs) {
174 Result &= AA->getArgModRefInfo(Call, ArgIdx);
176// Early-exit the moment we reach the bottom of the lattice. 192// We may have two calls. 193if (
constauto *Call1 = dyn_cast<CallBase>(
I)) {
194// Check if the two calls modify the same memory. 197// If this is a fence, just return ModRef. 200// Otherwise, check if the call modifies or references the 201// location this memory access defines. The best we can say 202// is that if the call references what this instruction 203// defines, it must be clobbered by this location. 216for (
constauto &AA : AAs) {
217 Result &= AA->getModRefInfo(Call, Loc, AAQI);
219// Early-exit the moment we reach the bottom of the lattice. 224// Try to refine the mod-ref info further using other API entry points to the 225// aggregate set of AA results. 227// We can completely ignore inaccessible memory here, because MemoryLocations 228// can only reference accessible memory. 231if (ME.doesNotAccessMemory())
236if ((ArgMR | OtherMR) != OtherMR) {
237// Refine the modref info for argument memory. We only bother to do this 238// if ArgMR is not a subset of OtherMR, otherwise this won't have an impact 239// on the final result. 242constValue *Arg =
I.value();
245unsigned ArgIdx =
I.index();
251 ArgMR &= AllArgsMask;
254 Result &= ArgMR | OtherMR;
256// Apply the ModRef mask. This ensures that if Loc is a constant memory 257// location, we take into account the fact that the call definitely could not 258// modify the memory location. 269for (
constauto &AA : AAs) {
270 Result &= AA->getModRefInfo(Call1, Call2, AAQI);
272// Early-exit the moment we reach the bottom of the lattice. 277// Try to refine the mod-ref info further using other API entry points to the 278// aggregate set of AA results. 280// If Call1 or Call2 are readnone, they don't interact. 282if (Call1B.doesNotAccessMemory())
286if (Call2B.doesNotAccessMemory())
289// If they both only read from memory, there is no dependence. 290if (Call1B.onlyReadsMemory() && Call2B.onlyReadsMemory())
293// If Call1 only reads memory, the only dependence on Call2 can be 294// from Call1 reading memory written by Call2. 295if (Call1B.onlyReadsMemory())
297elseif (Call1B.onlyWritesMemory())
300// If Call2 only access memory through arguments, accumulate the mod/ref 301// information from Call1's references to the memory referenced by 303if (Call2B.onlyAccessesArgPointees()) {
304if (!Call2B.doesAccessArgPointees())
311unsigned Call2ArgIdx = std::distance(Call2->
arg_begin(),
I);
315// ArgModRefC2 indicates what Call2 might do to Call2ArgLoc, and the 316// dependence of Call1 on that location is the inverse: 317// - If Call2 modifies location, dependence exists if Call1 reads or 319// - If Call2 only reads location, dependence exists if Call1 writes. 327// ModRefC1 indicates what Call1 might do to Call2ArgLoc, and we use 328// above ArgMask to update dependence info. 331 R = (R | ArgMask) & Result;
339// If Call1 only accesses memory through arguments, check if Call2 references 340// any of the memory referenced by Call1's arguments. If not, return NoModRef. 341if (Call1B.onlyAccessesArgPointees()) {
342if (!Call1B.doesAccessArgPointees())
349unsigned Call1ArgIdx = std::distance(Call1->
arg_begin(),
I);
353// ArgModRefC1 indicates what Call1 might do to Call1ArgLoc; if Call1 354// might Mod Call1ArgLoc, then we care about either a Mod or a Ref by 355// Call2. If Call1 might Ref, then we care only about a Mod by Call2. 360 R = (R | ArgModRefC1) & Result;
376for (
constauto &AA : AAs) {
377 Result &= AA->getMemoryEffects(Call, AAQI);
379// Early-exit the moment we reach the bottom of the lattice. 380if (Result.doesNotAccessMemory())
395for (
constauto &AA : AAs) {
396 Result &= AA->getMemoryEffects(
F);
398// Early-exit the moment we reach the bottom of the lattice. 399if (Result.doesNotAccessMemory())
426//===----------------------------------------------------------------------===// 427// Helper method implementation 428//===----------------------------------------------------------------------===// 433// Be conservative in the face of atomic. 437// If the load address doesn't alias the given address, it doesn't read 438// or write the specified memory. 444// Otherwise, a load just reads. 451// Be conservative in the face of atomic. 457// If the store address cannot alias the pointer in question, then the 458// specified memory cannot be modified by the store. 462// Examine the ModRef mask. If Mod isn't present, then return NoModRef. 463// This ensures that if Loc is a constant memory location, we take into 464// account the fact that the store definitely could not modify the memory 470// Otherwise, a store just writes. 477// All we know about a fence instruction is what we get from the ModRef 478// mask: if Loc is a constant memory location, the fence definitely could 490// If the va_arg address cannot alias the pointer in question, then the 491// specified memory cannot be accessed by the va_arg. 495// If the pointer is a pointer to invariant memory, then it could not have 496// been modified by this va_arg. 500// Otherwise, a va_arg reads and writes. 508// If the pointer is a pointer to invariant memory, 509// then it could not have been modified by this catchpad. 513// Otherwise, a catchpad reads and writes. 521// If the pointer is a pointer to invariant memory, 522// then it could not have been modified by this catchpad. 526// Otherwise, a catchret reads and writes. 533// Acquire/Release cmpxchg has properties that matter for arbitrary addresses. 539// If the cmpxchg address does not alias the location, it does not access 551// Acquire/Release atomicrmw has properties that matter for arbitrary addresses. 557// If the atomicrmw address does not alias the location, it does not access 567const std::optional<MemoryLocation> &OptLoc,
569if (OptLoc == std::nullopt) {
570if (
constauto *Call = dyn_cast<CallBase>(
I))
576switch (
I->getOpcode()) {
577case Instruction::VAArg:
579case Instruction::Load:
581case Instruction::Store:
583case Instruction::Fence:
585case Instruction::AtomicCmpXchg:
587case Instruction::AtomicRMW:
589case Instruction::Call:
590case Instruction::CallBr:
591case Instruction::Invoke:
593case Instruction::CatchPad:
595case Instruction::CatchRet:
598assert(!
I->mayReadOrWriteMemory() &&
599"Unhandled memory access instruction!");
604/// Return information about whether a particular call site modifies 605/// or reads the specified memory location \p MemLoc before instruction \p I 607/// FIXME: this is really just shoring-up a deficiency in alias analysis. 608/// BasicAA isn't willing to spend linear time determining whether an alloca 609/// was captured before or after this particular call, while we are. However, 610/// with a smarter AA in place, this test is just wasting compile time. 622constauto *Call = dyn_cast<CallBase>(
I);
623if (!Call || Call == Object)
627/* StoreCaptures */true,
I, DT,
628/* include Object */true))
633// Set flag only if no May found and all operands processed. 634for (
auto CI = Call->data_operands_begin(), CE = Call->data_operands_end();
635 CI != CE; ++CI, ++ArgNo) {
636// Only look at the no-capture or byval pointer arguments. If this 637// pointer were passed to arguments that were neither of these, then it 638// couldn't be no-capture. 639if (!(*CI)->getType()->isPointerTy() || !Call->doesNotCapture(ArgNo))
645// If this is a no-capture pointer argument, see if we can tell that it 646// is impossible to alias the pointer we're checking. If not, we have to 647// assume that the call could touch the pointer, even though it doesn't 651if (Call->doesNotAccessMemory(ArgNo))
653if (Call->onlyReadsMemory(ArgNo)) {
662/// canBasicBlockModify - Return true if it is possible for execution of the 663/// specified basic block to modify the location Loc. 670/// canInstructionRangeModRef - Return true if it is possible for the 671/// execution of the specified instructions to mod\ref (according to the 672/// mode) the location Loc. The instructions to consider are all 673/// of the instructions in the range of [I1,I2] INCLUSIVE. 674/// I1 and I2 must be in the same basic block. 680"Instructions not in same basic block!");
683 ++E;
// Convert from inclusive to exclusive range. 685for (;
I != E; ++
I)
// Check every instruction in range 691// Provide a definition for the root virtual destructor. 694// Provide a definition for the static object used to identify passes. 723"Function Alias Analysis Results",
false,
true)
733/// Run the wrapper pass to rebuild an aggregation over known AA passes. 735/// This is the legacy pass manager's interface to the new-style AA results 736/// aggregation object. Because this is somewhat shoe-horned into the legacy 737/// pass manager, we hard code all the specific alias analyses available into 738/// it. While the particular set enabled is configured via commandline flags, 739/// adding a new alias analysis to LLVM will require adding support for it to 742// NB! This *must* be reset before adding new AA results to the new 743// AAResults object because in the legacy pass manager, each instance 744// of these will refer to the *same* immutable analyses, registering and 745// unregistering themselves with them. We need to carefully tear down the 746// previous object first, in this case replacing it with an empty one, before 747// registering new results. 749newAAResults(getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
F)));
751// BasicAA is always available for function analyses. Also, we add it first 752// so that it can trump TBAA results when it proves MustAlias. 753// FIXME: TBAA should have an explicit mode to support this and then we 754// should reconsider the ordering here. 756 AAR->addAAResult(getAnalysis<BasicAAWrapperPass>().getResult());
758// Populate the results with the currently available AAs. 759if (
auto *WrapperPass = getAnalysisIfAvailable<ScopedNoAliasAAWrapperPass>())
760 AAR->addAAResult(WrapperPass->getResult());
761if (
auto *WrapperPass = getAnalysisIfAvailable<TypeBasedAAWrapperPass>())
762 AAR->addAAResult(WrapperPass->getResult());
763if (
auto *WrapperPass = getAnalysisIfAvailable<GlobalsAAWrapperPass>())
764 AAR->addAAResult(WrapperPass->getResult());
765if (
auto *WrapperPass = getAnalysisIfAvailable<SCEVAAWrapperPass>())
766 AAR->addAAResult(WrapperPass->getResult());
768// If available, run an external AA providing callback over the results as 770if (
auto *WrapperPass = getAnalysisIfAvailable<ExternalAAWrapperPass>())
772 WrapperPass->CB(*
this,
F, *AAR);
774// Analyses don't mutate the IR, so return false. 783// We also need to mark all the alias analysis passes we will potentially 784// probe in runOnFunction as used here to ensure the legacy pass manager 785// preserves them. This hard coding of lists of alias analyses is specific to 786// the legacy pass manager. 796for (
auto &Getter : ResultGetters)
802if (
constauto *Call = dyn_cast<CallBase>(V))
803return Call->hasRetAttr(Attribute::NoAlias);
808if (
constArgument *
A = dyn_cast<Argument>(V))
809returnA->hasNoAliasAttr() ||
A->hasByValAttr();
814if (isa<AllocaInst>(V))
816if (isa<GlobalValue>(V) && !isa<GlobalAlias>(V))
830// TODO: We can handle other cases here 831// 1) For GC languages, arguments to functions are often required to be 833// 2) Result of allocation routines are often base pointers. Leverage TLI. 834return (isa<AllocaInst>(V) || isa<GlobalVariable>(V));
838if (
auto *CB = dyn_cast<CallBase>(V))
842// The load case works because isNonEscapingLocalObject considers all 843// stores to be escapes (it passes true for the StoreCaptures argument 844// to PointerMayBeCaptured). 848// The inttoptr case works because isNonEscapingLocalObject considers all 849// means of converting or equating a pointer to an int (ptrtoint, ptr store 850// which could be followed by an integer load, ptr<->int compare) as 851// escaping, and objects located at well-known addresses via platform-specific 852// means cannot be considered non-escaping local objects. 853if (isa<IntToPtrInst>(V))
856// Same for inttoptr constant expressions. 857if (
auto *CE = dyn_cast<ConstantExpr>(V))
858if (CE->getOpcode() == Instruction::IntToPtr)
865bool &RequiresNoCaptureBeforeUnwind) {
866 RequiresNoCaptureBeforeUnwind =
false;
868// Alloca goes out of scope on unwind. 869if (isa<AllocaInst>(Object))
872// Byval goes out of scope on unwind. 873if (
auto *
A = dyn_cast<Argument>(Object))
874returnA->hasByValAttr() ||
A->hasAttribute(Attribute::DeadOnUnwind);
876// A noalias return is not accessible from any other code. If the pointer 877// does not escape prior to the unwind, then the caller cannot access the 880 RequiresNoCaptureBeforeUnwind =
true;
887// We don't consider globals as writable: While the physical memory is writable, 888// we may not have provenance to perform the write. 890bool &ExplicitlyDereferenceableOnly) {
891 ExplicitlyDereferenceableOnly =
false;
893// TODO: Alloca might not be writable after its lifetime ends. 894// See https://github.com/llvm/llvm-project/issues/51838. 895if (isa<AllocaInst>(Object))
898if (
auto *
A = dyn_cast<Argument>(Object)) {
899// Also require noalias, otherwise writability at function entry cannot be 900// generalized to writability at other program points, even if the pointer 902if (
A->hasAttribute(Attribute::Writable) &&
A->hasNoAliasAttr()) {
903 ExplicitlyDereferenceableOnly =
true;
907returnA->hasByValAttr();
910// TODO: Noalias shouldn't imply writability, this should check for an 911// allocator function instead. static cl::opt< bool > EnableAATrace("aa-trace", cl::Hidden, cl::init(false))
Print a trace of alias analysis queries and their results.
static bool isNoAliasOrByValArgument(const Value *V)
Function Alias Analysis Results
Atomic ordering constants.
This file contains the simple types necessary to represent the attributes associated with functions a...
This is the interface for LLVM's primary stateless and local alias analysis.
block Block Frequency Analysis
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static bool runOnFunction(Function &F, bool PostInlining)
This is the interface for a simple mod/ref and alias analysis over globals.
This file provides utility analysis objects describing memory locations.
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This is the interface for a SCEV-based alias analysis.
This is the interface for a metadata-based scoped no-alias analysis.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
This is the interface for a metadata-based TBAA.
A manager for alias analyses.
Result run(Function &F, FunctionAnalysisManager &AM)
This class stores info we want to provide to or retain within an alias query.
unsigned Depth
Query depth used to distinguish recursive queries.
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
ModRefInfo getModRefInfo(const Instruction *I, const std::optional< MemoryLocation > &OptLoc)
Check whether or not an instruction may read or write the optionally specified memory location.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
The main low level interface to the alias analysis implementation.
ModRefInfo getModRefInfoMask(const MemoryLocation &Loc, bool IgnoreLocals=false)
Returns a bitmask that should be unconditionally applied to the ModRef info of a memory location.
ModRefInfo callCapturesBefore(const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
Return information about whether a particular call site modifies or reads the specified memory locati...
AAResults(const TargetLibraryInfo &TLI)
MemoryEffects getMemoryEffects(const CallBase *Call)
Return the behavior of the given call site.
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
Handle invalidation events in the new pass manager.
ModRefInfo getArgModRefInfo(const CallBase *Call, unsigned ArgIdx)
Get the ModRef info associated with a pointer argument of a call.
bool canInstructionRangeModRef(const Instruction &I1, const Instruction &I2, const MemoryLocation &Loc, const ModRefInfo Mode)
Check if it is possible for the execution of the specified instructions to mod(according to the mode)...
bool canBasicBlockModify(const BasicBlock &BB, const MemoryLocation &Loc)
Check if it is possible for execution of the specified basic block to modify the location Loc.
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.
@ PartialAlias
The two locations alias, but only due to a partial overlap.
@ MustAlias
The two locations precisely alias each other.
constexpr int32_t getOffset() const
constexpr bool hasOffset() const
API to communicate dependencies between analyses during invalidation.
bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA)
Trigger the invalidation of some other analysis pass if not already handled and return whether it was...
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addUsedIfAvailable()
Add the specified Pass class to the set of analyses used by this pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
AnalysisUsage & addRequiredTransitive()
This class represents an incoming formal argument to a Function.
An instruction that atomically checks whether a specified value is in a memory location,...
AtomicOrdering getSuccessOrdering() const
Returns the success ordering constraint of this cmpxchg instruction.
an instruction that atomically reads a memory location, combines it with another value,...
AtomicOrdering getOrdering() const
Returns the ordering constraint of this rmw instruction.
Legacy wrapper pass to provide the BasicAAResult object.
LLVM Basic Block Representation.
InstListType::const_iterator const_iterator
const Instruction & front() const
const Instruction & back() const
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
User::op_iterator arg_begin()
Return the iterator pointing to the beginning of the argument list.
User::op_iterator arg_end()
Return the iterator pointing to the end of the argument list.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
An instruction for ordering other memory operations.
FunctionPass class - This class is used to implement most global optimizations.
Legacy wrapper pass to provide the GlobalsAAResult object.
ImmutablePass class - This class is used to provide information that does not need to be run.
An instruction for reading from memory.
MemoryEffectsBase getWithoutLoc(Location Loc) const
Get new MemoryEffectsBase with NoModRef on the given Loc.
ModRefInfo getModRef(Location Loc) const
Get ModRefInfo for the given Location.
static MemoryEffectsBase unknown()
Create MemoryEffectsBase that can read and write any memory.
Representation for a specific memory location.
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
LocationSize Size
The maximum size of the location, in address-units, or UnknownSize if the size is not known.
static MemoryLocation getBeforeOrAfter(const Value *Ptr, const AAMDNodes &AATags=AAMDNodes())
Return a location that may access any location before or after Ptr, while remaining within the underl...
const Value * Ptr
The address of the start of the location.
static MemoryLocation getForArgument(const CallBase *Call, unsigned ArgIdx, const TargetLibraryInfo *TLI)
Return a location representing a particular argument of a call.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A set of analyses that are preserved following a run of a transformation pass.
PreservedAnalysisChecker getChecker() const
Build a checker for this PreservedAnalyses and the specified analysis type.
Legacy wrapper pass to provide the SCEVAAResult object.
Legacy wrapper pass to provide the ScopedNoAliasAAResult object.
AAQueryInfo that uses SimpleCaptureAnalysis.
An instruction for storing to memory.
AtomicOrdering getOrdering() const
Returns the ordering constraint of this store instruction.
Analysis pass providing the TargetLibraryInfo.
Provides information about what library functions are available for the current target.
Legacy wrapper pass to provide the TypeBasedAAResult object.
bool isPointerTy() const
True if this is an instance of PointerType.
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
const ParentTy * getParent() const
self_iterator getIterator()
This class implements an extremely fast bulk output stream that can only output to a stream.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
cl::opt< bool > DisableBasicAA("disable-basic-aa", cl::Hidden, cl::init(false))
Allow disabling BasicAA from the AA results.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
bool isStrongerThanMonotonic(AtomicOrdering AO)
bool isBaseOfObject(const Value *V)
Return true if we know V to the base address of the corresponding memory object.
bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures, bool StoreCaptures, const Instruction *I, const DominatorTree *DT, bool IncludeI=false, unsigned MaxUsesToExplore=0, const LoopInfo *LI=nullptr)
PointerMayBeCapturedBefore - Return true if this pointer value may be captured by the enclosing funct...
const Value * getUnderlyingObject(const Value *V, unsigned MaxLookup=6)
This method strips off any GEP address adjustments, pointer casts or llvm.threadlocal....
bool isNoAliasCall(const Value *V)
Return true if this pointer is returned by a noalias function.
void initializeAAResultsWrapperPassPass(PassRegistry &)
bool isIntrinsicReturningPointerAliasingArgumentWithoutCapturing(const CallBase *Call, bool MustPreserveNullness)
{launder,strip}.invariant.group returns pointer that aliases its argument, and it only captures point...
bool isModSet(const ModRefInfo MRI)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool isModOrRefSet(const ModRefInfo MRI)
bool isNotVisibleOnUnwind(const Value *Object, bool &RequiresNoCaptureBeforeUnwind)
Return true if Object memory is not visible after an unwind, in the sense that program semantics cann...
ModRefInfo
Flags indicating whether a memory access modifies or references memory.
@ Ref
The access may reference the value stored in memory.
@ ModRef
The access may reference and may modify the value stored in memory.
@ Mod
The access may modify the value stored in memory.
@ NoModRef
The access neither references nor modifies the value stored in memory.
@ ArgMem
Access to memory via argument pointers.
@ InaccessibleMem
Memory that is inaccessible via LLVM IR.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
bool isIdentifiedFunctionLocal(const Value *V)
Return true if V is umabigously identified at the function-level.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
bool isEscapeSource(const Value *V)
Returns true if the pointer is one which would have been considered an escape by isNonEscapingLocalOb...
ImmutablePass * createExternalAAWrapperPass(std::function< void(Pass &, Function &, AAResults &)> Callback)
A wrapper pass around a callback which can be used to populate the AAResults in the AAResultsWrapperP...
void initializeExternalAAWrapperPassPass(PassRegistry &)
bool isNoModRef(const ModRefInfo MRI)
bool isIdentifiedObject(const Value *V)
Return true if this pointer refers to a distinct and identifiable object.
bool isStrongerThan(AtomicOrdering AO, AtomicOrdering Other)
Returns true if ao is stronger than other as defined by the AtomicOrdering lattice,...
bool isRefSet(const ModRefInfo MRI)
bool isWritableObject(const Value *Object, bool &ExplicitlyDereferenceableOnly)
Return true if the Object is writable, in the sense that any location based on this pointer that can ...
Implement std::hash so that hash_code can be used in STL containers.
A special type used by analysis passes to provide an address that identifies that particular analysis...
A wrapper pass for external alias analyses.
std::function< void(Pass &, Function &, AAResults &)> CallbackT