Go to the documentation of this file.
51 V2->printAsOperand(os2,
true,
M);
59 errs() <<
" " << AR <<
":\t" << o1 <<
", " << o2 <<
"\n";
66 errs() <<
" " << Msg <<
": Ptr: ";
68 errs() <<
"\t<->" << *
I <<
'\n';
75 errs() <<
" " << Msg <<
": " << *CallA <<
" <-> " << *CallB <<
'\n';
83 errs() <<
" " << AR <<
": " << *V1 <<
" <-> " << *
V2 <<
'\n';
89 && !isa<ConstantPointerNull>(V);
107 for (
auto &
I :
F.args())
108 if (
I.getType()->isPointerTy())
112 if (Inst.getType()->isPointerTy())
114 if (
EvalAAMD && isa<LoadInst>(&Inst))
116 if (
EvalAAMD && isa<StoreInst>(&Inst))
118 if (
auto *Call = dyn_cast<CallBase>(&Inst)) {
124 for (
Use &DataOp : Call->data_ops())
130 for (
Use &
Op : Inst.operands())
138 errs() <<
"Function: " <<
F.getName() <<
": " << Pointers.
size()
139 <<
" pointers, " << Calls.
size() <<
" call sites\n";
145 Type *I1ElTy = cast<PointerType>((*I1)->getType())->getElementType();
151 Type *I2ElTy = cast<PointerType>((*I2)->getType())->getElementType();
234 for (
auto Pointer : Pointers) {
236 Type *ElTy = cast<PointerType>(
Pointer->getType())->getElementType();
275 Pointer,
F.getParent());
322 CallB,
F.getParent());
331 errs() <<
"(" << Num * 100LL / Sum <<
"." << ((Num * 1000LL / Sum) % 10)
336 if (FunctionCount == 0)
340 NoAliasCount + MayAliasCount + PartialAliasCount + MustAliasCount;
341 errs() <<
"===== Alias Analysis Evaluator Report =====\n";
343 errs() <<
" Alias Analysis Evaluator Summary: No pointers!\n";
345 errs() <<
" " << AliasSum <<
" Total Alias Queries Performed\n";
346 errs() <<
" " << NoAliasCount <<
" no alias responses ";
348 errs() <<
" " << MayAliasCount <<
" may alias responses ";
350 errs() <<
" " << PartialAliasCount <<
" partial alias responses ";
352 errs() <<
" " << MustAliasCount <<
" must alias responses ";
354 errs() <<
" Alias Analysis Evaluator Pointer Alias Summary: "
355 << NoAliasCount * 100 / AliasSum <<
"%/"
356 << MayAliasCount * 100 / AliasSum <<
"%/"
357 << PartialAliasCount * 100 / AliasSum <<
"%/"
358 << MustAliasCount * 100 / AliasSum <<
"%\n";
362 int64_t ModRefSum = NoModRefCount + RefCount + ModCount + ModRefCount +
363 MustCount + MustRefCount + MustModCount + MustModRefCount;
364 if (ModRefSum == 0) {
365 errs() <<
" Alias Analysis Mod/Ref Evaluator Summary: no "
368 errs() <<
" " << ModRefSum <<
" Total ModRef Queries Performed\n";
369 errs() <<
" " << NoModRefCount <<
" no mod/ref responses ";
371 errs() <<
" " << ModCount <<
" mod responses ";
373 errs() <<
" " << RefCount <<
" ref responses ";
375 errs() <<
" " << ModRefCount <<
" mod & ref responses ";
377 errs() <<
" " << MustCount <<
" must responses ";
379 errs() <<
" " << MustModCount <<
" must mod responses ";
381 errs() <<
" " << MustRefCount <<
" must ref responses ";
383 errs() <<
" " << MustModRefCount <<
" must mod & ref responses ";
385 errs() <<
" Alias Analysis Evaluator Mod/Ref Summary: "
386 << NoModRefCount * 100 / ModRefSum <<
"%/"
387 << ModCount * 100 / ModRefSum <<
"%/" << RefCount * 100 / ModRefSum
388 <<
"%/" << ModRefCount * 100 / ModRefSum <<
"%/"
389 << MustCount * 100 / ModRefSum <<
"%/"
390 << MustRefCount * 100 / ModRefSum <<
"%/"
391 << MustModCount * 100 / ModRefSum <<
"%/"
392 << MustModRefCount * 100 / ModRefSum <<
"%\n";
398 std::unique_ptr<AAEvaluator> P;
417 P->runInternal(
F, getAnalysis<AAResultsWrapperPass>().getAAResults());
429 "Exhaustive Alias Analysis Precision Evaluator",
false,
A set of analyses that are preserved following a run of a transformation pass.
@ NoModRef
The access neither references nor modifies the value stored in memory.
A manager for alias analyses.
bool isSized(SmallPtrSetImpl< Type * > *Visited=nullptr) const
Return true if it makes sense to take the size of this type.
@ MayAlias
The two locations may or may not alias.
@ PartialAlias
The two locations alias, but only due to a partial overlap.
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
A parsed version of the target data layout string in and methods for querying it.
constexpr static LocationSize afterPointer()
Any location after the base pointer (but still within the underlying object).
bool isPointerTy() const
True if this is an instance of PointerType.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
A raw_ostream that writes to an std::string.
size_type size() const
Determine the number of elements in the SetVector.
The instances of the Type class are immutable: once they are created, they are never changed.
The possible results of an alias query.
static cl::opt< bool > PrintMust("print-must", cl::ReallyHidden)
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static void PrintPercent(int64_t Num, int64_t Sum)
static void PrintLoadStoreResults(AliasResult AR, bool P, const Value *V1, const Value *V2, const Module *M)
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
@ Must
Must is provided for completeness, but no routines will return only Must today.
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
static cl::opt< bool > PrintMustMod("print-mustmod", cl::ReallyHidden)
@ MustRef
The access may reference the value stored in memory, a mustAlias relation was found,...
FunctionPass * createAAEvalPass()
Create a wrapper of the above for the legacy pass manager.
iterator begin()
Get an iterator to the beginning of the SetVector.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
@ Ref
The access may reference the value stored in memory.
static cl::opt< bool > PrintNoModRef("print-no-modref", cl::ReallyHidden)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
@ MustModRef
The access may reference, modify or both the value stored in memory, a mustAlias relation was found,...
@ MustMod
The access may modify the value stored in memory, a mustAlias relation was found, and no mayAlias or ...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
static cl::opt< bool > EvalAAMD("evaluate-aa-metadata", cl::ReallyHidden)
Represent the analysis usage information of a pass.
static cl::opt< bool > PrintMustRef("print-mustref", cl::ReallyHidden)
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
static LocationSize precise(uint64_t Value)
void initializeAAEvalLegacyPassPass(PassRegistry &)
static cl::opt< bool > PrintPartialAlias("print-partial-aliases", cl::ReallyHidden)
static cl::opt< bool > PrintAll("print-all-alias-modref-info", cl::ReallyHidden)
static cl::opt< bool > PrintNoAlias("print-no-aliases", cl::ReallyHidden)
static cl::opt< bool > PrintMustModRef("print-mustmodref", cl::ReallyHidden)
inst_range instructions(Function *F)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
This class evaluates LLVM IR, producing the Constant representing each SSA instruction.
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
static cl::opt< bool > PrintMod("print-mod", cl::ReallyHidden)
static void PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr, Module *M)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Run the pass over the function.
static cl::opt< bool > PrintModRef("print-modref", cl::ReallyHidden)
A Module instance is used to store all the information related to an LLVM module.
void printAsOperand(raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
Print the name of this Value out to the specified raw_ostream.
bool insert(const value_type &X)
Insert a new element into the SetVector.
void swap(bool DoSwap=true)
Helper for processing AliasResult for swapped memory location pairs.
Type * getType() const
All values are typed, get the type of this value.
static void PrintResults(AliasResult AR, bool P, const Value *V1, const Value *V2, const Module *M)
@ NoAlias
The two locations do not alias at all.
@ Mod
The access may modify the value stored in memory.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
@ MustAlias
The two locations precisely alias each other.
amdgpu Simplify well known AMD library false FunctionCallee Callee
static cl::opt< bool > PrintMustAlias("print-must-aliases", cl::ReallyHidden)
void setPreservesAll()
Set by analyses that do not transform their input at all.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
The main low level interface to the alias analysis implementation.
iterator end()
Get an iterator to the end of the SetVector.
static bool isInterestingPointer(Value *V)
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object.
static cl::opt< bool > PrintRef("print-ref", cl::ReallyHidden)
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
A SetVector that performs no allocations if smaller than a certain size.
A container for analyses that lazily runs them and caches their results.
FunctionPass class - This class is used to implement most global optimizations.
INITIALIZE_PASS_BEGIN(AAEvalLegacyPass, "aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true) INITIALIZE_PASS_END(AAEvalLegacyPass
AnalysisUsage & addRequired()
static cl::opt< bool > PrintMayAlias("print-may-aliases", cl::ReallyHidden)
LLVM Value Representation.
ModRefInfo getModRefInfo(const CallBase *Call, const MemoryLocation &Loc)
getModRefInfo (for call sites) - Return information about whether a particular call site modifies or ...
@ ModRef
The access may reference and may modify the value stored in memory.
A Use represents the edge between a Value definition and its users.