LLVM  15.0.0git
AliasAnalysisEvaluator.cpp
Go to the documentation of this file.
1 //===- AliasAnalysisEvaluator.cpp - Alias Analysis Accuracy Evaluator -----===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "llvm/ADT/SetVector.h"
12 #include "llvm/IR/DataLayout.h"
13 #include "llvm/IR/Function.h"
14 #include "llvm/IR/InstIterator.h"
15 #include "llvm/IR/Instructions.h"
16 #include "llvm/IR/Module.h"
17 #include "llvm/InitializePasses.h"
18 #include "llvm/Pass.h"
21 using namespace llvm;
22 
23 static cl::opt<bool> PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
24 
25 static cl::opt<bool> PrintNoAlias("print-no-aliases", cl::ReallyHidden);
26 static cl::opt<bool> PrintMayAlias("print-may-aliases", cl::ReallyHidden);
27 static cl::opt<bool> PrintPartialAlias("print-partial-aliases", cl::ReallyHidden);
28 static cl::opt<bool> PrintMustAlias("print-must-aliases", cl::ReallyHidden);
29 
30 static cl::opt<bool> PrintNoModRef("print-no-modref", cl::ReallyHidden);
31 static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
32 static cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
33 static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
34 static cl::opt<bool> PrintMust("print-must", cl::ReallyHidden);
35 static cl::opt<bool> PrintMustRef("print-mustref", cl::ReallyHidden);
36 static cl::opt<bool> PrintMustMod("print-mustmod", cl::ReallyHidden);
37 static cl::opt<bool> PrintMustModRef("print-mustmodref", cl::ReallyHidden);
38 
39 static cl::opt<bool> EvalAAMD("evaluate-aa-metadata", cl::ReallyHidden);
40 
41 static void PrintResults(AliasResult AR, bool P,
42  std::pair<const Value *, Type *> Loc1,
43  std::pair<const Value *, Type *> Loc2,
44  const Module *M) {
45  if (PrintAll || P) {
46  Type *Ty1 = Loc1.second, *Ty2 = Loc2.second;
47  unsigned AS1 = Loc1.first->getType()->getPointerAddressSpace();
48  unsigned AS2 = Loc2.first->getType()->getPointerAddressSpace();
49  std::string o1, o2;
50  {
51  raw_string_ostream os1(o1), os2(o2);
52  Loc1.first->printAsOperand(os1, false, M);
53  Loc2.first->printAsOperand(os2, false, M);
54  }
55 
56  if (o2 < o1) {
57  std::swap(o1, o2);
58  std::swap(Ty1, Ty2);
59  std::swap(AS1, AS2);
60  // Change offset sign for the local AR, for printing only.
61  AR.swap();
62  }
63  errs() << " " << AR << ":\t";
64  Ty1->print(errs(), false, /* NoDetails */ true);
65  if (AS1 != 0)
66  errs() << " addrspace(" << AS1 << ")";
67  errs() << "* " << o1 << ", ";
68  Ty2->print(errs(), false, /* NoDetails */ true);
69  if (AS2 != 0)
70  errs() << " addrspace(" << AS2 << ")";
71  errs() << "* " << o2 << "\n";
72  }
73 }
74 
75 static inline void PrintModRefResults(
76  const char *Msg, bool P, Instruction *I,
77  std::pair<const Value *, Type *> Loc, Module *M) {
78  if (PrintAll || P) {
79  errs() << " " << Msg << ": Ptr: ";
80  Loc.second->print(errs(), false, /* NoDetails */ true);
81  errs() << "* ";
82  Loc.first->printAsOperand(errs(), false, M);
83  errs() << "\t<->" << *I << '\n';
84  }
85 }
86 
87 static inline void PrintModRefResults(const char *Msg, bool P, CallBase *CallA,
88  CallBase *CallB, Module *M) {
89  if (PrintAll || P) {
90  errs() << " " << Msg << ": " << *CallA << " <-> " << *CallB << '\n';
91  }
92 }
93 
94 static inline void PrintLoadStoreResults(AliasResult AR, bool P,
95  const Value *V1, const Value *V2,
96  const Module *M) {
97  if (PrintAll || P) {
98  errs() << " " << AR << ": " << *V1 << " <-> " << *V2 << '\n';
99  }
100 }
101 
103  runInternal(F, AM.getResult<AAManager>(F));
104  return PreservedAnalyses::all();
105 }
106 
107 void AAEvaluator::runInternal(Function &F, AAResults &AA) {
108  const DataLayout &DL = F.getParent()->getDataLayout();
109 
110  ++FunctionCount;
111 
114  SetVector<Value *> Loads;
115  SetVector<Value *> Stores;
116 
117  for (Instruction &Inst : instructions(F)) {
118  if (auto *LI = dyn_cast<LoadInst>(&Inst)) {
119  Pointers.insert({LI->getPointerOperand(), LI->getType()});
120  Loads.insert(LI);
121  } else if (auto *SI = dyn_cast<StoreInst>(&Inst)) {
122  Pointers.insert({SI->getPointerOperand(),
123  SI->getValueOperand()->getType()});
124  Stores.insert(SI);
125  } else if (auto *CB = dyn_cast<CallBase>(&Inst))
126  Calls.insert(CB);
127  }
128 
131  errs() << "Function: " << F.getName() << ": " << Pointers.size()
132  << " pointers, " << Calls.size() << " call sites\n";
133 
134  // iterate over the worklist, and run the full (n^2)/2 disambiguations
135  for (auto I1 = Pointers.begin(), E = Pointers.end(); I1 != E; ++I1) {
136  LocationSize Size1 = LocationSize::precise(DL.getTypeStoreSize(I1->second));
137  for (auto I2 = Pointers.begin(); I2 != I1; ++I2) {
138  LocationSize Size2 =
139  LocationSize::precise(DL.getTypeStoreSize(I2->second));
140  AliasResult AR = AA.alias(I1->first, Size1, I2->first, Size2);
141  switch (AR) {
143  PrintResults(AR, PrintNoAlias, *I1, *I2, F.getParent());
144  ++NoAliasCount;
145  break;
147  PrintResults(AR, PrintMayAlias, *I1, *I2, F.getParent());
148  ++MayAliasCount;
149  break;
151  PrintResults(AR, PrintPartialAlias, *I1, *I2, F.getParent());
152  ++PartialAliasCount;
153  break;
155  PrintResults(AR, PrintMustAlias, *I1, *I2, F.getParent());
156  ++MustAliasCount;
157  break;
158  }
159  }
160  }
161 
162  if (EvalAAMD) {
163  // iterate over all pairs of load, store
164  for (Value *Load : Loads) {
165  for (Value *Store : Stores) {
166  AliasResult AR = AA.alias(MemoryLocation::get(cast<LoadInst>(Load)),
167  MemoryLocation::get(cast<StoreInst>(Store)));
168  switch (AR) {
170  PrintLoadStoreResults(AR, PrintNoAlias, Load, Store, F.getParent());
171  ++NoAliasCount;
172  break;
174  PrintLoadStoreResults(AR, PrintMayAlias, Load, Store, F.getParent());
175  ++MayAliasCount;
176  break;
178  PrintLoadStoreResults(AR, PrintPartialAlias, Load, Store, F.getParent());
179  ++PartialAliasCount;
180  break;
182  PrintLoadStoreResults(AR, PrintMustAlias, Load, Store, F.getParent());
183  ++MustAliasCount;
184  break;
185  }
186  }
187  }
188 
189  // iterate over all pairs of store, store
190  for (SetVector<Value *>::iterator I1 = Stores.begin(), E = Stores.end();
191  I1 != E; ++I1) {
192  for (SetVector<Value *>::iterator I2 = Stores.begin(); I2 != I1; ++I2) {
193  AliasResult AR = AA.alias(MemoryLocation::get(cast<StoreInst>(*I1)),
194  MemoryLocation::get(cast<StoreInst>(*I2)));
195  switch (AR) {
197  PrintLoadStoreResults(AR, PrintNoAlias, *I1, *I2, F.getParent());
198  ++NoAliasCount;
199  break;
201  PrintLoadStoreResults(AR, PrintMayAlias, *I1, *I2, F.getParent());
202  ++MayAliasCount;
203  break;
205  PrintLoadStoreResults(AR, PrintPartialAlias, *I1, *I2, F.getParent());
206  ++PartialAliasCount;
207  break;
209  PrintLoadStoreResults(AR, PrintMustAlias, *I1, *I2, F.getParent());
210  ++MustAliasCount;
211  break;
212  }
213  }
214  }
215  }
216 
217  // Mod/ref alias analysis: compare all pairs of calls and values
218  for (CallBase *Call : Calls) {
219  for (const auto &Pointer : Pointers) {
221  LocationSize::precise(DL.getTypeStoreSize(Pointer.second));
222  switch (AA.getModRefInfo(Call, Pointer.first, Size)) {
224  PrintModRefResults("NoModRef", PrintNoModRef, Call, Pointer,
225  F.getParent());
226  ++NoModRefCount;
227  break;
228  case ModRefInfo::Mod:
229  PrintModRefResults("Just Mod", PrintMod, Call, Pointer, F.getParent());
230  ++ModCount;
231  break;
232  case ModRefInfo::Ref:
233  PrintModRefResults("Just Ref", PrintRef, Call, Pointer, F.getParent());
234  ++RefCount;
235  break;
236  case ModRefInfo::ModRef:
237  PrintModRefResults("Both ModRef", PrintModRef, Call, Pointer,
238  F.getParent());
239  ++ModRefCount;
240  break;
241  case ModRefInfo::Must:
242  PrintModRefResults("Must", PrintMust, Call, Pointer, F.getParent());
243  ++MustCount;
244  break;
245  case ModRefInfo::MustMod:
246  PrintModRefResults("Just Mod (MustAlias)", PrintMustMod, Call, Pointer,
247  F.getParent());
248  ++MustModCount;
249  break;
250  case ModRefInfo::MustRef:
251  PrintModRefResults("Just Ref (MustAlias)", PrintMustRef, Call, Pointer,
252  F.getParent());
253  ++MustRefCount;
254  break;
256  PrintModRefResults("Both ModRef (MustAlias)", PrintMustModRef, Call,
257  Pointer, F.getParent());
258  ++MustModRefCount;
259  break;
260  }
261  }
262  }
263 
264  // Mod/ref alias analysis: compare all pairs of calls
265  for (CallBase *CallA : Calls) {
266  for (CallBase *CallB : Calls) {
267  if (CallA == CallB)
268  continue;
269  switch (AA.getModRefInfo(CallA, CallB)) {
271  PrintModRefResults("NoModRef", PrintNoModRef, CallA, CallB,
272  F.getParent());
273  ++NoModRefCount;
274  break;
275  case ModRefInfo::Mod:
276  PrintModRefResults("Just Mod", PrintMod, CallA, CallB, F.getParent());
277  ++ModCount;
278  break;
279  case ModRefInfo::Ref:
280  PrintModRefResults("Just Ref", PrintRef, CallA, CallB, F.getParent());
281  ++RefCount;
282  break;
283  case ModRefInfo::ModRef:
284  PrintModRefResults("Both ModRef", PrintModRef, CallA, CallB,
285  F.getParent());
286  ++ModRefCount;
287  break;
288  case ModRefInfo::Must:
289  PrintModRefResults("Must", PrintMust, CallA, CallB, F.getParent());
290  ++MustCount;
291  break;
292  case ModRefInfo::MustMod:
293  PrintModRefResults("Just Mod (MustAlias)", PrintMustMod, CallA, CallB,
294  F.getParent());
295  ++MustModCount;
296  break;
297  case ModRefInfo::MustRef:
298  PrintModRefResults("Just Ref (MustAlias)", PrintMustRef, CallA, CallB,
299  F.getParent());
300  ++MustRefCount;
301  break;
303  PrintModRefResults("Both ModRef (MustAlias)", PrintMustModRef, CallA,
304  CallB, F.getParent());
305  ++MustModRefCount;
306  break;
307  }
308  }
309  }
310 }
311 
312 static void PrintPercent(int64_t Num, int64_t Sum) {
313  errs() << "(" << Num * 100LL / Sum << "." << ((Num * 1000LL / Sum) % 10)
314  << "%)\n";
315 }
316 
318  if (FunctionCount == 0)
319  return;
320 
321  int64_t AliasSum =
322  NoAliasCount + MayAliasCount + PartialAliasCount + MustAliasCount;
323  errs() << "===== Alias Analysis Evaluator Report =====\n";
324  if (AliasSum == 0) {
325  errs() << " Alias Analysis Evaluator Summary: No pointers!\n";
326  } else {
327  errs() << " " << AliasSum << " Total Alias Queries Performed\n";
328  errs() << " " << NoAliasCount << " no alias responses ";
329  PrintPercent(NoAliasCount, AliasSum);
330  errs() << " " << MayAliasCount << " may alias responses ";
331  PrintPercent(MayAliasCount, AliasSum);
332  errs() << " " << PartialAliasCount << " partial alias responses ";
333  PrintPercent(PartialAliasCount, AliasSum);
334  errs() << " " << MustAliasCount << " must alias responses ";
335  PrintPercent(MustAliasCount, AliasSum);
336  errs() << " Alias Analysis Evaluator Pointer Alias Summary: "
337  << NoAliasCount * 100 / AliasSum << "%/"
338  << MayAliasCount * 100 / AliasSum << "%/"
339  << PartialAliasCount * 100 / AliasSum << "%/"
340  << MustAliasCount * 100 / AliasSum << "%\n";
341  }
342 
343  // Display the summary for mod/ref analysis
344  int64_t ModRefSum = NoModRefCount + RefCount + ModCount + ModRefCount +
345  MustCount + MustRefCount + MustModCount + MustModRefCount;
346  if (ModRefSum == 0) {
347  errs() << " Alias Analysis Mod/Ref Evaluator Summary: no "
348  "mod/ref!\n";
349  } else {
350  errs() << " " << ModRefSum << " Total ModRef Queries Performed\n";
351  errs() << " " << NoModRefCount << " no mod/ref responses ";
352  PrintPercent(NoModRefCount, ModRefSum);
353  errs() << " " << ModCount << " mod responses ";
354  PrintPercent(ModCount, ModRefSum);
355  errs() << " " << RefCount << " ref responses ";
356  PrintPercent(RefCount, ModRefSum);
357  errs() << " " << ModRefCount << " mod & ref responses ";
358  PrintPercent(ModRefCount, ModRefSum);
359  errs() << " " << MustCount << " must responses ";
360  PrintPercent(MustCount, ModRefSum);
361  errs() << " " << MustModCount << " must mod responses ";
362  PrintPercent(MustModCount, ModRefSum);
363  errs() << " " << MustRefCount << " must ref responses ";
364  PrintPercent(MustRefCount, ModRefSum);
365  errs() << " " << MustModRefCount << " must mod & ref responses ";
366  PrintPercent(MustModRefCount, ModRefSum);
367  errs() << " Alias Analysis Evaluator Mod/Ref Summary: "
368  << NoModRefCount * 100 / ModRefSum << "%/"
369  << ModCount * 100 / ModRefSum << "%/" << RefCount * 100 / ModRefSum
370  << "%/" << ModRefCount * 100 / ModRefSum << "%/"
371  << MustCount * 100 / ModRefSum << "%/"
372  << MustRefCount * 100 / ModRefSum << "%/"
373  << MustModCount * 100 / ModRefSum << "%/"
374  << MustModRefCount * 100 / ModRefSum << "%\n";
375  }
376 }
377 
378 namespace llvm {
380  std::unique_ptr<AAEvaluator> P;
381 
382 public:
383  static char ID; // Pass identification, replacement for typeid
386  }
387 
388  void getAnalysisUsage(AnalysisUsage &AU) const override {
390  AU.setPreservesAll();
391  }
392 
393  bool doInitialization(Module &M) override {
394  P.reset(new AAEvaluator());
395  return false;
396  }
397 
398  bool runOnFunction(Function &F) override {
399  P->runInternal(F, getAnalysis<AAResultsWrapperPass>().getAAResults());
400  return false;
401  }
402  bool doFinalization(Module &M) override {
403  P.reset();
404  return false;
405  }
406 };
407 }
408 
409 char AAEvalLegacyPass::ID = 0;
411  "Exhaustive Alias Analysis Precision Evaluator", false,
412  true)
415  "Exhaustive Alias Analysis Precision Evaluator", false,
416  true)
417 
llvm::Check::Size
@ Size
Definition: FileCheck.h:77
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
llvm::ModRefInfo::NoModRef
@ NoModRef
The access neither references nor modifies the value stored in memory.
llvm::AAManager
A manager for alias analyses.
Definition: AliasAnalysis.h:1299
llvm::AliasResult::MayAlias
@ MayAlias
The two locations may or may not alias.
Definition: AliasAnalysis.h:102
llvm::AliasResult::PartialAlias
@ PartialAlias
The two locations alias, but only due to a partial overlap.
Definition: AliasAnalysis.h:104
llvm::MemoryLocation::get
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
Definition: MemoryLocation.cpp:35
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
M
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
Definition: README.txt:252
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it.
Definition: DataLayout.h:113
llvm::AnalysisManager::getResult
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Definition: PassManager.h:780
InstIterator.h
aa
aa
Definition: AliasAnalysis.cpp:847
llvm::Function
Definition: Function.h:60
P
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
Definition: README-SSE.txt:411
Pass.h
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:632
llvm::SetVector::size
size_type size() const
Determine the number of elements in the SetVector.
Definition: SetVector.h:77
llvm::AAEvalLegacyPass
Definition: AliasAnalysisEvaluator.cpp:379
llvm::Type::getPointerAddressSpace
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
Definition: DerivedTypes.h:729
true
basic Basic Alias true
Definition: BasicAliasAnalysis.cpp:1909
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
Module.h
eval
aa eval
Definition: AliasAnalysisEvaluator.cpp:414
llvm::AliasResult
The possible results of an alias query.
Definition: AliasAnalysis.h:81
PrintMust
static cl::opt< bool > PrintMust("print-must", cl::ReallyHidden)
llvm::errs
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
Definition: raw_ostream.cpp:893
PrintPercent
static void PrintPercent(int64_t Num, int64_t Sum)
Definition: AliasAnalysisEvaluator.cpp:312
PrintLoadStoreResults
static void PrintLoadStoreResults(AliasResult AR, bool P, const Value *V1, const Value *V2, const Module *M)
Definition: AliasAnalysisEvaluator.cpp:94
llvm::codeview::PointerMode::Pointer
@ Pointer
llvm::cl::ReallyHidden
@ ReallyHidden
Definition: CommandLine.h:140
llvm::ModRefInfo::Must
@ Must
Must is provided for completeness, but no routines will return only Must today.
I1
@ I1
Definition: DXILOpLowering.cpp:37
F
#define F(x, y, z)
Definition: MD5.cpp:55
AliasAnalysis.h
llvm::AAEvalLegacyPass::runOnFunction
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Definition: AliasAnalysisEvaluator.cpp:398
CommandLine.h
llvm::SPII::Load
@ Load
Definition: SparcInstrInfo.h:32
PrintMustMod
static cl::opt< bool > PrintMustMod("print-mustmod", cl::ReallyHidden)
llvm::ModRefInfo::MustRef
@ MustRef
The access may reference the value stored in memory, a mustAlias relation was found,...
llvm::createAAEvalPass
FunctionPass * createAAEvalPass()
Create a wrapper of the above for the legacy pass manager.
Definition: AliasAnalysisEvaluator.cpp:418
llvm::SetVector::begin
iterator begin()
Get an iterator to the beginning of the SetVector.
Definition: SetVector.h:82
llvm::PassRegistry::getPassRegistry
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Definition: PassRegistry.cpp:31
llvm::ModRefInfo::Ref
@ Ref
The access may reference the value stored in memory.
llvm::AAResults
Definition: AliasAnalysis.h:511
PrintNoModRef
static cl::opt< bool > PrintNoModRef("print-no-modref", cl::ReallyHidden)
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::ModRefInfo::MustModRef
@ MustModRef
The access may reference, modify or both the value stored in memory, a mustAlias relation was found,...
llvm::ModRefInfo::MustMod
@ MustMod
The access may modify the value stored in memory, a mustAlias relation was found, and no mayAlias or ...
llvm::LocationSize
Definition: MemoryLocation.h:66
llvm::AAEvalLegacyPass::getAnalysisUsage
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition: AliasAnalysisEvaluator.cpp:388
EvalAAMD
static cl::opt< bool > EvalAAMD("evaluate-aa-metadata", cl::ReallyHidden)
llvm::Type::print
void print(raw_ostream &O, bool IsForDebug=false, bool NoDetails=false) const
Print the current type.
Definition: AsmWriter.cpp:4553
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
PrintMustRef
static cl::opt< bool > PrintMustRef("print-mustref", cl::ReallyHidden)
false
Definition: StackSlotColoring.cpp:141
llvm::Instruction
Definition: Instruction.h:42
llvm::AAEvalLegacyPass::doFinalization
bool doFinalization(Module &M) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
Definition: AliasAnalysisEvaluator.cpp:402
llvm::LocationSize::precise
static LocationSize precise(uint64_t Value)
Definition: MemoryLocation.h:101
llvm::SPII::Store
@ Store
Definition: SparcInstrInfo.h:33
llvm::initializeAAEvalLegacyPassPass
void initializeAAEvalLegacyPassPass(PassRegistry &)
llvm::CallingConv::ID
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
INITIALIZE_PASS_END
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:58
PrintPartialAlias
static cl::opt< bool > PrintPartialAlias("print-partial-aliases", cl::ReallyHidden)
PrintAll
static cl::opt< bool > PrintAll("print-all-alias-modref-info", cl::ReallyHidden)
llvm::AAEvalLegacyPass::ID
static char ID
Definition: AliasAnalysisEvaluator.cpp:383
llvm::cl::opt< bool >
PrintNoAlias
static cl::opt< bool > PrintNoAlias("print-no-aliases", cl::ReallyHidden)
PrintMustModRef
static cl::opt< bool > PrintMustModRef("print-mustmodref", cl::ReallyHidden)
llvm::instructions
inst_range instructions(Function *F)
Definition: InstIterator.h:133
llvm::AAEvalLegacyPass::AAEvalLegacyPass
AAEvalLegacyPass()
Definition: AliasAnalysisEvaluator.cpp:384
INITIALIZE_PASS_DEPENDENCY
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::Evaluator
This class evaluates LLVM IR, producing the Constant representing each SSA instruction.
Definition: Evaluator.h:37
llvm::AAEvalLegacyPass::doInitialization
bool doInitialization(Module &M) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
Definition: AliasAnalysisEvaluator.cpp:393
PrintMod
static cl::opt< bool > PrintMod("print-mod", cl::ReallyHidden)
std::swap
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:853
llvm::AAEvaluator::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Run the pass over the function.
Definition: AliasAnalysisEvaluator.cpp:102
SI
StandardInstrumentations SI(Debug, VerifyEach)
PrintModRef
static cl::opt< bool > PrintModRef("print-modref", cl::ReallyHidden)
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::SetVector::insert
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition: SetVector.h:141
llvm::AliasResult::swap
void swap(bool DoSwap=true)
Helper for processing AliasResult for swapped memory location pairs.
Definition: AliasAnalysis.h:130
DataLayout.h
llvm::AliasResult::NoAlias
@ NoAlias
The two locations do not alias at all.
Definition: AliasAnalysis.h:99
llvm::ModRefInfo::Mod
@ Mod
The access may modify the value stored in memory.
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::AliasResult::MustAlias
@ MustAlias
The two locations precisely alias each other.
Definition: AliasAnalysis.h:106
llvm::AAEvaluator::~AAEvaluator
~AAEvaluator()
Definition: AliasAnalysisEvaluator.cpp:317
llvm::AMDGPU::SendMsg::Msg
const CustomOperand< const MCSubtargetInfo & > Msg[]
Definition: AMDGPUAsmUtils.cpp:39
llvm::NVPTX::PTXLdStInstCode::V2
@ V2
Definition: NVPTX.h:123
PrintMustAlias
static cl::opt< bool > PrintMustAlias("print-must-aliases", cl::ReallyHidden)
llvm::AnalysisUsage::setPreservesAll
void setPreservesAll()
Set by analyses that do not transform their input at all.
Definition: PassAnalysisSupport.h:130
llvm::PreservedAnalyses::all
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: PassManager.h:158
Function.h
PrintResults
static void PrintResults(AliasResult AR, bool P, std::pair< const Value *, Type * > Loc1, std::pair< const Value *, Type * > Loc2, const Module *M)
Definition: AliasAnalysisEvaluator.cpp:41
AA
llvm::SetVector::end
iterator end()
Get an iterator to the end of the SetVector.
Definition: SetVector.h:92
llvm::AAEvaluator
Definition: AliasAnalysisEvaluator.h:34
AliasAnalysisEvaluator.h
Instructions.h
P
#define P(N)
llvm::AAResultsWrapperPass
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object.
Definition: AliasAnalysis.h:1347
PrintRef
static cl::opt< bool > PrintRef("print-ref", cl::ReallyHidden)
llvm::CallBase
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Definition: InstrTypes.h:1174
llvm::SmallSetVector
A SetVector that performs no allocations if smaller than a certain size.
Definition: SetVector.h:307
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:42
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:308
INITIALIZE_PASS_BEGIN
INITIALIZE_PASS_BEGIN(AAEvalLegacyPass, "aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true) INITIALIZE_PASS_END(AAEvalLegacyPass
llvm::AnalysisUsage::addRequired
AnalysisUsage & addRequired()
Definition: PassAnalysisSupport.h:75
PrintModRefResults
static void PrintModRefResults(const char *Msg, bool P, Instruction *I, std::pair< const Value *, Type * > Loc, Module *M)
Definition: AliasAnalysisEvaluator.cpp:75
raw_ostream.h
PrintMayAlias
static cl::opt< bool > PrintMayAlias("print-may-aliases", cl::ReallyHidden)
llvm::SetVector
A vector that has set insertion semantics.
Definition: SetVector.h:40
InitializePasses.h
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::ModRefInfo::ModRef
@ ModRef
The access may reference and may modify the value stored in memory.
SetVector.h