LLVM  15.0.0git
AliasSetTracker.h
Go to the documentation of this file.
1 //===- llvm/Analysis/AliasSetTracker.h - Build Alias Sets -------*- C++ -*-===//
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 //
9 // This file defines two classes: AliasSetTracker and AliasSet. These interfaces
10 // are used to classify a collection of pointer references into a maximal number
11 // of disjoint sets. Each AliasSet object constructed by the AliasSetTracker
12 // object refers to memory disjoint from the other sets.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_ANALYSIS_ALIASSETTRACKER_H
17 #define LLVM_ANALYSIS_ALIASSETTRACKER_H
18 
19 #include "llvm/ADT/DenseMap.h"
20 #include "llvm/ADT/DenseMapInfo.h"
21 #include "llvm/ADT/ilist.h"
22 #include "llvm/ADT/ilist_node.h"
24 #include "llvm/IR/Instruction.h"
25 #include "llvm/IR/PassManager.h"
26 #include "llvm/IR/ValueHandle.h"
27 #include <cassert>
28 #include <cstddef>
29 #include <iterator>
30 #include <vector>
31 
32 namespace llvm {
33 
34 class AAResults;
35 class AliasResult;
36 class AliasSetTracker;
37 class AnyMemSetInst;
38 class AnyMemTransferInst;
39 class BasicBlock;
40 class LoadInst;
41 class raw_ostream;
42 class StoreInst;
43 class VAArgInst;
44 class Value;
45 
46 class AliasSet : public ilist_node<AliasSet> {
47  friend class AliasSetTracker;
48 
49  class PointerRec {
50  Value *Val; // The pointer this record corresponds to.
51  PointerRec **PrevInList = nullptr;
52  PointerRec *NextInList = nullptr;
53  AliasSet *AS = nullptr;
55  AAMDNodes AAInfo;
56 
57  // Whether the size for this record has been set at all. This makes no
58  // guarantees about the size being known.
59  bool isSizeSet() const { return Size != LocationSize::mapEmpty(); }
60 
61  public:
62  PointerRec(Value *V)
63  : Val(V), AAInfo(DenseMapInfo<AAMDNodes>::getEmptyKey()) {}
64 
65  Value *getValue() const { return Val; }
66 
67  PointerRec *getNext() const { return NextInList; }
68  bool hasAliasSet() const { return AS != nullptr; }
69 
70  PointerRec** setPrevInList(PointerRec **PIL) {
71  PrevInList = PIL;
72  return &NextInList;
73  }
74 
75  bool updateSizeAndAAInfo(LocationSize NewSize, const AAMDNodes &NewAAInfo) {
76  bool SizeChanged = false;
77  if (NewSize != Size) {
78  LocationSize OldSize = Size;
79  Size = isSizeSet() ? Size.unionWith(NewSize) : NewSize;
80  SizeChanged = OldSize != Size;
81  }
82 
84  // We don't have a AAInfo yet. Set it to NewAAInfo.
85  AAInfo = NewAAInfo;
86  else {
87  AAMDNodes Intersection(AAInfo.intersect(NewAAInfo));
88  SizeChanged |= Intersection != AAInfo;
89  AAInfo = Intersection;
90  }
91  return SizeChanged;
92  }
93 
94  LocationSize getSize() const {
95  assert(isSizeSet() && "Getting an unset size!");
96  return Size;
97  }
98 
99  /// Return the AAInfo, or null if there is no information or conflicting
100  /// information.
101  AAMDNodes getAAInfo() const {
102  // If we have missing or conflicting AAInfo, return null.
103  if (AAInfo == DenseMapInfo<AAMDNodes>::getEmptyKey() ||
105  return AAMDNodes();
106  return AAInfo;
107  }
108 
109  AliasSet *getAliasSet(AliasSetTracker &AST) {
110  assert(AS && "No AliasSet yet!");
111  if (AS->Forward) {
112  AliasSet *OldAS = AS;
113  AS = OldAS->getForwardedTarget(AST);
114  AS->addRef();
115  OldAS->dropRef(AST);
116  }
117  return AS;
118  }
119 
120  void setAliasSet(AliasSet *as) {
121  assert(!AS && "Already have an alias set!");
122  AS = as;
123  }
124 
125  void eraseFromList() {
126  if (NextInList) NextInList->PrevInList = PrevInList;
127  *PrevInList = NextInList;
128  if (AS->PtrListEnd == &NextInList) {
129  AS->PtrListEnd = PrevInList;
130  assert(*AS->PtrListEnd == nullptr && "List not terminated right!");
131  }
132  delete this;
133  }
134  };
135 
136  // Doubly linked list of nodes.
137  PointerRec *PtrList = nullptr;
138  PointerRec **PtrListEnd;
139  // Forwarding pointer.
140  AliasSet *Forward = nullptr;
141 
142  /// All instructions without a specific address in this alias set.
143  /// In rare cases this vector can have a null'ed out WeakVH
144  /// instances (can happen if some other loop pass deletes an
145  /// instruction in this list).
146  std::vector<WeakVH> UnknownInsts;
147 
148  /// Number of nodes pointing to this AliasSet plus the number of AliasSets
149  /// forwarding to it.
150  unsigned RefCount : 27;
151 
152  // Signifies that this set should be considered to alias any pointer.
153  // Use when the tracker holding this set is saturated.
154  unsigned AliasAny : 1;
155 
156  /// The kinds of access this alias set models.
157  ///
158  /// We keep track of whether this alias set merely refers to the locations of
159  /// memory (and not any particular access), whether it modifies or references
160  /// the memory, or whether it does both. The lattice goes from "NoAccess" to
161  /// either RefAccess or ModAccess, then to ModRefAccess as necessary.
162  enum AccessLattice {
163  NoAccess = 0,
164  RefAccess = 1,
165  ModAccess = 2,
166  ModRefAccess = RefAccess | ModAccess
167  };
168  unsigned Access : 2;
169 
170  /// The kind of alias relationship between pointers of the set.
171  ///
172  /// These represent conservatively correct alias results between any members
173  /// of the set. We represent these independently of the values of alias
174  /// results in order to pack it into a single bit. Lattice goes from
175  /// MustAlias to MayAlias.
176  enum AliasLattice {
177  SetMustAlias = 0, SetMayAlias = 1
178  };
179  unsigned Alias : 1;
180 
181  unsigned SetSize = 0;
182 
183  void addRef() { ++RefCount; }
184 
185  void dropRef(AliasSetTracker &AST) {
186  assert(RefCount >= 1 && "Invalid reference count detected!");
187  if (--RefCount == 0)
188  removeFromTracker(AST);
189  }
190 
191  Instruction *getUnknownInst(unsigned i) const {
192  assert(i < UnknownInsts.size());
193  return cast_or_null<Instruction>(UnknownInsts[i]);
194  }
195 
196 public:
197  AliasSet(const AliasSet &) = delete;
198  AliasSet &operator=(const AliasSet &) = delete;
199 
200  /// Accessors...
201  bool isRef() const { return Access & RefAccess; }
202  bool isMod() const { return Access & ModAccess; }
203  bool isMustAlias() const { return Alias == SetMustAlias; }
204  bool isMayAlias() const { return Alias == SetMayAlias; }
205 
206  /// Return true if this alias set should be ignored as part of the
207  /// AliasSetTracker object.
208  bool isForwardingAliasSet() const { return Forward; }
209 
210  /// Merge the specified alias set into this alias set.
211  void mergeSetIn(AliasSet &AS, AliasSetTracker &AST);
212 
213  // Alias Set iteration - Allow access to all of the pointers which are part of
214  // this alias set.
215  class iterator;
216  iterator begin() const { return iterator(PtrList); }
217  iterator end() const { return iterator(); }
218  bool empty() const { return PtrList == nullptr; }
219 
220  // Unfortunately, ilist::size() is linear, so we have to add code to keep
221  // track of the list's exact size.
222  unsigned size() { return SetSize; }
223 
224  /// If this alias set is known to contain a single instruction and *only* a
225  /// single unique instruction, return it. Otherwise, return nullptr.
227 
228  void print(raw_ostream &OS) const;
229  void dump() const;
230 
231  /// Define an iterator for alias sets... this is just a forward iterator.
232  class iterator {
233  PointerRec *CurNode;
234 
235  public:
236  using iterator_category = std::forward_iterator_tag;
237  using value_type = PointerRec;
238  using difference_type = std::ptrdiff_t;
239  using pointer = value_type *;
241 
242  explicit iterator(PointerRec *CN = nullptr) : CurNode(CN) {}
243 
244  bool operator==(const iterator& x) const {
245  return CurNode == x.CurNode;
246  }
247  bool operator!=(const iterator& x) const { return !operator==(x); }
248 
250  assert(CurNode && "Dereferencing AliasSet.end()!");
251  return *CurNode;
252  }
253  value_type *operator->() const { return &operator*(); }
254 
255  Value *getPointer() const { return CurNode->getValue(); }
256  LocationSize getSize() const { return CurNode->getSize(); }
257  AAMDNodes getAAInfo() const { return CurNode->getAAInfo(); }
258 
259  iterator& operator++() { // Preincrement
260  assert(CurNode && "Advancing past AliasSet.end()!");
261  CurNode = CurNode->getNext();
262  return *this;
263  }
264  iterator operator++(int) { // Postincrement
265  iterator tmp = *this; ++*this; return tmp;
266  }
267  };
268 
269 private:
270  // Can only be created by AliasSetTracker.
271  AliasSet()
272  : PtrListEnd(&PtrList), RefCount(0), AliasAny(false), Access(NoAccess),
273  Alias(SetMustAlias) {}
274 
275  PointerRec *getSomePointer() const {
276  return PtrList;
277  }
278 
279  /// Return the real alias set this represents. If this has been merged with
280  /// another set and is forwarding, return the ultimate destination set. This
281  /// also implements the union-find collapsing as well.
282  AliasSet *getForwardedTarget(AliasSetTracker &AST) {
283  if (!Forward) return this;
284 
285  AliasSet *Dest = Forward->getForwardedTarget(AST);
286  if (Dest != Forward) {
287  Dest->addRef();
288  Forward->dropRef(AST);
289  Forward = Dest;
290  }
291  return Dest;
292  }
293 
294  void removeFromTracker(AliasSetTracker &AST);
295 
296  void addPointer(AliasSetTracker &AST, PointerRec &Entry, LocationSize Size,
297  const AAMDNodes &AAInfo, bool KnownMustAlias = false,
298  bool SkipSizeUpdate = false);
299  void addUnknownInst(Instruction *I, AAResults &AA);
300 
301  void removeUnknownInst(AliasSetTracker &AST, Instruction *I) {
302  bool WasEmpty = UnknownInsts.empty();
303  for (size_t i = 0, e = UnknownInsts.size(); i != e; ++i)
304  if (UnknownInsts[i] == I) {
305  UnknownInsts[i] = UnknownInsts.back();
306  UnknownInsts.pop_back();
307  --i; --e; // Revisit the moved entry.
308  }
309  if (!WasEmpty && UnknownInsts.empty())
310  dropRef(AST);
311  }
312 
313 public:
314  /// If the specified pointer "may" (or must) alias one of the members in the
315  /// set return the appropriate AliasResult. Otherwise return NoAlias.
316  AliasResult aliasesPointer(const Value *Ptr, LocationSize Size,
317  const AAMDNodes &AAInfo, AAResults &AA) const;
318  bool aliasesUnknownInst(const Instruction *Inst, AAResults &AA) const;
319 };
320 
321 inline raw_ostream& operator<<(raw_ostream &OS, const AliasSet &AS) {
322  AS.print(OS);
323  return OS;
324 }
325 
327  /// A CallbackVH to arrange for AliasSetTracker to be notified whenever a
328  /// Value is deleted.
329  class ASTCallbackVH final : public CallbackVH {
330  AliasSetTracker *AST;
331 
332  void deleted() override;
333  void allUsesReplacedWith(Value *) override;
334 
335  public:
336  ASTCallbackVH(Value *V, AliasSetTracker *AST = nullptr);
337 
338  ASTCallbackVH &operator=(Value *V);
339  };
340  /// Traits to tell DenseMap that tell us how to compare and hash the value
341  /// handle.
342  struct ASTCallbackVHDenseMapInfo : public DenseMapInfo<Value *> {};
343 
344  AAResults &AA;
345  ilist<AliasSet> AliasSets;
346 
347  using PointerMapType = DenseMap<ASTCallbackVH, AliasSet::PointerRec *,
348  ASTCallbackVHDenseMapInfo>;
349 
350  // Map from pointers to their node
351  PointerMapType PointerMap;
352 
353 public:
354  /// Create an empty collection of AliasSets, and use the specified alias
355  /// analysis object to disambiguate load and store addresses.
356  explicit AliasSetTracker(AAResults &AA) : AA(AA) {}
358 
359  /// These methods are used to add different types of instructions to the alias
360  /// sets. Adding a new instruction can result in one of three actions
361  /// happening:
362  ///
363  /// 1. If the instruction doesn't alias any other sets, create a new set.
364  /// 2. If the instruction aliases exactly one set, add it to the set
365  /// 3. If the instruction aliases multiple sets, merge the sets, and add
366  /// the instruction to the result.
367  ///
368  /// These methods return true if inserting the instruction resulted in the
369  /// addition of a new alias set (i.e., the pointer did not alias anything).
370  ///
371  void add(Value *Ptr, LocationSize Size, const AAMDNodes &AAInfo); // Add a loc
372  void add(LoadInst *LI);
373  void add(StoreInst *SI);
374  void add(VAArgInst *VAAI);
375  void add(AnyMemSetInst *MSI);
376  void add(AnyMemTransferInst *MTI);
377  void add(Instruction *I); // Dispatch to one of the other add methods...
378  void add(BasicBlock &BB); // Add all instructions in basic block
379  void add(const AliasSetTracker &AST); // Add alias relations from another AST
380  void addUnknown(Instruction *I);
381 
382  void clear();
383 
384  /// Return the alias sets that are active.
385  const ilist<AliasSet> &getAliasSets() const { return AliasSets; }
386 
387  /// Return the alias set which contains the specified memory location. If
388  /// the memory location aliases two or more existing alias sets, will have
389  /// the effect of merging those alias sets before the single resulting alias
390  /// set is returned.
391  AliasSet &getAliasSetFor(const MemoryLocation &MemLoc);
392 
393  /// Return the underlying alias analysis object used by this tracker.
394  AAResults &getAliasAnalysis() const { return AA; }
395 
396  /// This method is used to remove a pointer value from the AliasSetTracker
397  /// entirely. It should be used when an instruction is deleted from the
398  /// program to update the AST. If you don't use this, you would have dangling
399  /// pointers to deleted instructions.
400  void deleteValue(Value *PtrVal);
401 
402  /// This method should be used whenever a preexisting value in the program is
403  /// copied or cloned, introducing a new value. Note that it is ok for clients
404  /// that use this method to introduce the same value multiple times: if the
405  /// tracker already knows about a value, it will ignore the request.
406  void copyValue(Value *From, Value *To);
407 
410 
411  const_iterator begin() const { return AliasSets.begin(); }
412  const_iterator end() const { return AliasSets.end(); }
413 
414  iterator begin() { return AliasSets.begin(); }
415  iterator end() { return AliasSets.end(); }
416 
417  void print(raw_ostream &OS) const;
418  void dump() const;
419 
420 private:
421  friend class AliasSet;
422 
423  // The total number of pointers contained in all "may" alias sets.
424  unsigned TotalMayAliasSetSize = 0;
425 
426  // A non-null value signifies this AST is saturated. A saturated AST lumps
427  // all pointers into a single "May" set.
428  AliasSet *AliasAnyAS = nullptr;
429 
430  void removeAliasSet(AliasSet *AS);
431 
432  /// Just like operator[] on the map, except that it creates an entry for the
433  /// pointer if it doesn't already exist.
434  AliasSet::PointerRec &getEntryFor(Value *V) {
435  AliasSet::PointerRec *&Entry = PointerMap[ASTCallbackVH(V, this)];
436  if (!Entry)
437  Entry = new AliasSet::PointerRec(V);
438  return *Entry;
439  }
440 
441  AliasSet &addPointer(MemoryLocation Loc, AliasSet::AccessLattice E);
442  AliasSet *mergeAliasSetsForPointer(const Value *Ptr, LocationSize Size,
443  const AAMDNodes &AAInfo,
444  bool &MustAliasAll);
445 
446  /// Merge all alias sets into a single set that is considered to alias any
447  /// pointer.
448  AliasSet &mergeAllAliasSets();
449 
450  AliasSet *findAliasSetForUnknownInst(Instruction *Inst);
451 };
452 
454  AST.print(OS);
455  return OS;
456 }
457 
458 class AliasSetsPrinterPass : public PassInfoMixin<AliasSetsPrinterPass> {
459  raw_ostream &OS;
460 
461 public:
462  explicit AliasSetsPrinterPass(raw_ostream &OS);
464 };
465 
466 } // end namespace llvm
467 
468 #endif // LLVM_ANALYSIS_ALIASSETTRACKER_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:76
i
i
Definition: README.txt:29
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
llvm::AliasSetTracker::addUnknown
void addUnknown(Instruction *I)
Definition: AliasSetTracker.cpp:423
as
compiles conv shl5 shl ret i32 or10 it would be better as
Definition: README.txt:615
llvm::AliasSetTracker::~AliasSetTracker
~AliasSetTracker()
Definition: AliasSetTracker.h:357
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::VAArgInst
This class represents the va_arg llvm instruction, which returns an argument of the specified type gi...
Definition: Instructions.h:1832
llvm::AliasSetTracker::end
const_iterator end() const
Definition: AliasSetTracker.h:412
llvm::AliasSetTracker::getAliasSets
const ilist< AliasSet > & getAliasSets() const
Return the alias sets that are active.
Definition: AliasSetTracker.h:385
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371
llvm::Function
Definition: Function.h:60
llvm::AliasSet::AliasSet
AliasSet(const AliasSet &)=delete
ilist.h
llvm::AliasSet::isMod
bool isMod() const
Definition: AliasSetTracker.h:202
llvm::AliasSet::iterator::iterator
iterator(PointerRec *CN=nullptr)
Definition: AliasSetTracker.h:242
llvm::AliasSetTracker::print
void print(raw_ostream &OS) const
Definition: AliasSetTracker.cpp:683
llvm::AliasSetTracker
Definition: AliasSetTracker.h:326
llvm::AliasSet::iterator::getSize
LocationSize getSize() const
Definition: AliasSetTracker.h:256
llvm::AAMDNodes
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition: Metadata.h:652
llvm::AliasSet::iterator::difference_type
std::ptrdiff_t difference_type
Definition: AliasSetTracker.h:238
DenseMap.h
llvm::AliasSetTracker::end
iterator end()
Definition: AliasSetTracker.h:415
llvm::AliasSet::isRef
bool isRef() const
Accessors...
Definition: AliasSetTracker.h:201
tmp
alloca< 16 x float >, align 16 %tmp2=alloca< 16 x float >, align 16 store< 16 x float > %A,< 16 x float > *%tmp %s=bitcast< 16 x float > *%tmp to i8 *%s2=bitcast< 16 x float > *%tmp2 to i8 *call void @llvm.memcpy.i64(i8 *%s, i8 *%s2, i64 64, i32 16) %R=load< 16 x float > *%tmp2 ret< 16 x float > %R } declare void @llvm.memcpy.i64(i8 *nocapture, i8 *nocapture, i64, i32) nounwind which compiles to:_foo:subl $140, %esp movaps %xmm3, 112(%esp) movaps %xmm2, 96(%esp) movaps %xmm1, 80(%esp) movaps %xmm0, 64(%esp) movl 60(%esp), %eax movl %eax, 124(%esp) movl 56(%esp), %eax movl %eax, 120(%esp) movl 52(%esp), %eax< many many more 32-bit copies > movaps(%esp), %xmm0 movaps 16(%esp), %xmm1 movaps 32(%esp), %xmm2 movaps 48(%esp), %xmm3 addl $140, %esp ret On Nehalem, it may even be cheaper to just use movups when unaligned than to fall back to lower-granularity chunks. Implement processor-specific optimizations for parity with GCC on these processors. GCC does two optimizations:1. ix86_pad_returns inserts a noop before ret instructions if immediately preceded by a conditional branch or is the target of a jump. 2. ix86_avoid_jump_misspredicts inserts noops in cases where a 16-byte block of code contains more than 3 branches. The first one is done for all AMDs, Core2, and "Generic" The second one is done for:Atom, Pentium Pro, all AMDs, Pentium 4, Nocona, Core 2, and "Generic" Testcase:int x(int a) { return(a &0xf0)> >4 tmp
Definition: README.txt:1347
llvm::AliasSet::print
void print(raw_ostream &OS) const
Definition: AliasSetTracker.cpp:642
llvm::iplist
An intrusive list with ownership and callbacks specified/controlled by ilist_traits,...
Definition: ilist.h:391
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:55
llvm::AliasSetTracker::clear
void clear()
Definition: AliasSetTracker.cpp:282
llvm::AliasSet::iterator::operator*
value_type & operator*() const
Definition: AliasSetTracker.h:249
Instruction.h
llvm::AliasSet::end
iterator end() const
Definition: AliasSetTracker.h:217
llvm::DenseMapInfo
An information struct used to provide DenseMap with the various necessary components for a given valu...
Definition: APInt.h:34
llvm::AliasSet::iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: AliasSetTracker.h:236
llvm::AliasSet::iterator::pointer
value_type * pointer
Definition: AliasSetTracker.h:239
llvm::AliasSet::iterator::reference
value_type & reference
Definition: AliasSetTracker.h:240
llvm::AAResults
Definition: AliasAnalysis.h:511
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::LocationSize
Definition: MemoryLocation.h:66
llvm::AliasSetTracker::dump
void dump() const
Definition: AliasSetTracker.cpp:695
llvm::AliasSetsPrinterPass
Definition: AliasSetTracker.h:458
llvm::AliasSet
Definition: AliasSetTracker.h:46
llvm::AliasSet::iterator::operator!=
bool operator!=(const iterator &x) const
Definition: AliasSetTracker.h:247
false
Definition: StackSlotColoring.cpp:141
llvm::AliasSet::isForwardingAliasSet
bool isForwardingAliasSet() const
Return true if this alias set should be ignored as part of the AliasSetTracker object.
Definition: AliasSetTracker.h:208
llvm::AliasSetsPrinterPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: AliasSetTracker.cpp:762
llvm::Instruction
Definition: Instruction.h:42
llvm::AliasSet::iterator::getPointer
Value * getPointer() const
Definition: AliasSetTracker.h:255
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::operator<<
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
Definition: APFixedPoint.h:230
llvm::AliasSet::empty
bool empty() const
Definition: AliasSetTracker.h:218
llvm::AliasSet::iterator::getAAInfo
AAMDNodes getAAInfo() const
Definition: AliasSetTracker.h:257
llvm::AliasSet::mergeSetIn
void mergeSetIn(AliasSet &AS, AliasSetTracker &AST)
Merge the specified alias set into this alias set.
Definition: AliasSetTracker.cpp:44
llvm::AnyMemTransferInst
Definition: IntrinsicInst.h:1117
llvm::AliasSet::operator=
AliasSet & operator=(const AliasSet &)=delete
llvm::StoreInst
An instruction for storing to memory.
Definition: Instructions.h:305
llvm::AliasSetTracker::add
void add(Value *Ptr, LocationSize Size, const AAMDNodes &AAInfo)
These methods are used to add different types of instructions to the alias sets.
Definition: AliasSetTracker.cpp:393
llvm::numbers::e
constexpr double e
Definition: MathExtras.h:57
MemoryLocation.h
llvm::DenseMap< ASTCallbackVH, AliasSet::PointerRec *, ASTCallbackVHDenseMapInfo >
llvm::AliasSet::size
unsigned size()
Definition: AliasSetTracker.h:222
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::AliasSet::isMayAlias
bool isMayAlias() const
Definition: AliasSetTracker.h:204
llvm::AliasSet::dump
void dump() const
Definition: AliasSetTracker.cpp:694
llvm::AliasSetTracker::getAliasAnalysis
AAResults & getAliasAnalysis() const
Return the underlying alias analysis object used by this tracker.
Definition: AliasSetTracker.h:394
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::AliasSet::iterator::operator==
bool operator==(const iterator &x) const
Definition: AliasSetTracker.h:244
SI
StandardInstrumentations SI(Debug, VerifyEach)
llvm::AliasSetsPrinterPass::AliasSetsPrinterPass
AliasSetsPrinterPass(raw_ostream &OS)
Definition: AliasSetTracker.cpp:760
llvm::AAMDNodes::intersect
AAMDNodes intersect(const AAMDNodes &Other) const
Given two sets of AAMDNodes that apply to the same pointer, give the best AAMDNodes that are compatib...
Definition: Metadata.h:695
llvm::AliasSetTracker::getAliasSetFor
AliasSet & getAliasSetFor(const MemoryLocation &MemLoc)
Return the alias set which contains the specified memory location.
Definition: AliasSetTracker.cpp:342
llvm::ISD::BasicBlock
@ BasicBlock
Various leaf nodes.
Definition: ISDOpcodes.h:71
llvm::AliasSet::iterator
Define an iterator for alias sets... this is just a forward iterator.
Definition: AliasSetTracker.h:232
llvm::AliasSet::aliasesPointer
AliasResult aliasesPointer(const Value *Ptr, LocationSize Size, const AAMDNodes &AAInfo, AAResults &AA) const
If the specified pointer "may" (or must) alias one of the members in the set return the appropriate A...
Definition: AliasSetTracker.cpp:190
llvm::AliasSetTracker::copyValue
void copyValue(Value *From, Value *To)
This method should be used whenever a preexisting value in the program is copied or cloned,...
Definition: AliasSetTracker.cpp:569
llvm::LocationSize::mapEmpty
constexpr static LocationSize mapEmpty()
Definition: MemoryLocation.h:138
llvm::DenseMapInfo< AAMDNodes >::getTombstoneKey
static AAMDNodes getTombstoneKey()
Definition: Metadata.h:749
llvm::LoadInst
An instruction for reading from memory.
Definition: Instructions.h:176
ValueHandle.h
llvm::AliasSetTracker::deleteValue
void deleteValue(Value *PtrVal)
This method is used to remove a pointer value from the AliasSetTracker entirely.
Definition: AliasSetTracker.cpp:541
llvm::ilist_node
Definition: ilist_node.h:149
llvm::AliasSet::iterator::operator++
iterator operator++(int)
Definition: AliasSetTracker.h:264
llvm::DenseMapInfo< AAMDNodes >::getEmptyKey
static AAMDNodes getEmptyKey()
Definition: Metadata.h:744
llvm::AnyMemSetInst
This class represents any memset intrinsic.
Definition: IntrinsicInst.h:1098
llvm::ilist_iterator
Iterator for intrusive lists based on ilist_node.
Definition: ilist_iterator.h:57
llvm::AliasSet::iterator::operator++
iterator & operator++()
Definition: AliasSetTracker.h:259
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
PassManager.h
x
TODO unsigned x
Definition: README.txt:10
llvm::CallbackVH
Value handle with callbacks on RAUW and destruction.
Definition: ValueHandle.h:383
llvm::AliasSetTracker::begin
const_iterator begin() const
Definition: AliasSetTracker.h:411
AA
llvm::AliasSetTracker::AliasSetTracker
AliasSetTracker(AAResults &AA)
Create an empty collection of AliasSets, and use the specified alias analysis object to disambiguate ...
Definition: AliasSetTracker.h:356
llvm::AliasSet::begin
iterator begin() const
Definition: AliasSetTracker.h:216
llvm::AliasSet::AliasSetTracker
friend class AliasSetTracker
Definition: AliasSetTracker.h:47
llvm::AliasSet::isMustAlias
bool isMustAlias() const
Definition: AliasSetTracker.h:203
ilist_node.h
DenseMapInfo.h
llvm::AliasSet::getUniqueInstruction
Instruction * getUniqueInstruction()
If this alias set is known to contain a single instruction and only a single unique instruction,...
Definition: AliasSetTracker.cpp:257
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:42
llvm::AliasSet::iterator::value_type
PointerRec value_type
Definition: AliasSetTracker.h:237
BB
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
Definition: README.txt:39
From
BlockVerifier::State From
Definition: BlockVerifier.cpp:55
llvm::AliasSet::iterator::operator->
value_type * operator->() const
Definition: AliasSetTracker.h:253
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::MemoryLocation
Representation for a specific memory location.
Definition: MemoryLocation.h:210
llvm::AliasSet::aliasesUnknownInst
bool aliasesUnknownInst(const Instruction *Inst, AAResults &AA) const
Definition: AliasSetTracker.cpp:230
llvm::AliasSetTracker::begin
iterator begin()
Definition: AliasSetTracker.h:414