LLVM 23.0.0git
MemoryDependenceAnalysis.h
Go to the documentation of this file.
1//===- llvm/Analysis/MemoryDependenceAnalysis.h - Memory Deps ---*- 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 the MemoryDependenceAnalysis analysis pass.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H
14#define LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H
15
16#include "llvm/ADT/DenseMap.h"
23#include "llvm/IR/PassManager.h"
25#include "llvm/IR/ValueHandle.h"
26#include "llvm/Pass.h"
27#include <optional>
28
29namespace llvm {
30
31class AssumptionCache;
32class DominatorTree;
33class PHITransAddr;
34
35/// A memory dependence query can return one of three different answers.
36class MemDepResult {
37 enum DepType {
38 /// Clients of MemDep never see this.
39 ///
40 /// Entries with this marker occur in a LocalDeps map or NonLocalDeps map
41 /// when the instruction they previously referenced was removed from
42 /// MemDep. In either case, the entry may include an instruction pointer.
43 /// If so, the pointer is an instruction in the block where scanning can
44 /// start from, saving some work.
45 ///
46 /// In a default-constructed MemDepResult object, the type will be Invalid
47 /// and the instruction pointer will be null.
48 Invalid = 0,
49
50 /// This is a dependence on the specified instruction which clobbers the
51 /// desired value. The pointer member of the MemDepResult pair holds the
52 /// instruction that clobbers the memory. For example, this occurs when we
53 /// see a may-aliased store to the memory location we care about.
54 ///
55 /// There are several cases that may be interesting here:
56 /// 1. Loads are clobbered by may-alias stores.
57 /// 2. Loads are considered clobbered by partially-aliased loads. The
58 /// client may choose to analyze deeper into these cases.
59 Clobber,
60
61 /// This is a dependence on the specified instruction which defines or
62 /// produces the desired memory location. The pointer member of the
63 /// MemDepResult pair holds the instruction that defines the memory.
64 ///
65 /// Cases of interest:
66 /// 1. This could be a load or store for dependence queries on
67 /// load/store. The value loaded or stored is the produced value.
68 /// Note that the pointer operand may be different than that of the
69 /// queried pointer due to must aliases and phi translation. Note
70 /// that the def may not be the same type as the query, the pointers
71 /// may just be must aliases.
72 /// 2. For loads and stores, this could be an allocation instruction. In
73 /// this case, the load is loading an undef value or a store is the
74 /// first store to (that part of) the allocation.
75 /// 3. Dependence queries on calls return Def only when they are readonly
76 /// calls or memory use intrinsics with identical callees and no
77 /// intervening clobbers. No validation is done that the operands to
78 /// the calls are the same.
79 /// 4. For loads and stores, this could be a select instruction that
80 /// defines pointer to this memory location. In this case, users can
81 /// find non-clobbered Defs for both select values that are reaching
82 // the desired memory location (there is still a guarantee that there
83 // are no clobbers between analyzed memory location and select).
84 Def,
85
86 /// This marker indicates that the query has no known dependency in the
87 /// specified block.
88 ///
89 /// More detailed state info is encoded in the upper part of the pair (i.e.
90 /// the Instruction*)
91 Other
92 };
93
94 /// If DepType is "Other", the upper part of the sum type is an encoding of
95 /// the following more detailed type information.
96 enum OtherType {
97 /// This marker indicates that the query has no dependency in the specified
98 /// block.
99 ///
100 /// To find out more, the client should query other predecessor blocks.
101 NonLocal = 1,
102 /// This marker indicates that the query has no dependency in the specified
103 /// function.
104 NonFuncLocal,
105 /// This marker indicates that the query dependency is unknown.
106 Unknown
107 };
108
109 using ValueTy = PointerSumType<
114 ValueTy Value;
115
116 explicit MemDepResult(ValueTy V) : Value(V) {}
117
118public:
119 MemDepResult() = default;
120
121 /// get methods: These are static ctor methods for creating various
122 /// MemDepResult kinds.
123 static MemDepResult getDef(Instruction *Inst) {
124 assert(Inst && "Def requires inst");
126 }
127 static MemDepResult getClobber(Instruction *Inst) {
128 assert(Inst && "Clobber requires inst");
130 }
131 static MemDepResult getNonLocal() {
132 return MemDepResult(ValueTy::create<Other>(NonLocal));
133 }
134 static MemDepResult getNonFuncLocal() {
135 return MemDepResult(ValueTy::create<Other>(NonFuncLocal));
136 }
137 static MemDepResult getUnknown() {
138 return MemDepResult(ValueTy::create<Other>(Unknown));
139 }
140
141 /// Tests if this MemDepResult represents a query that is an instruction
142 /// clobber dependency.
143 bool isClobber() const { return Value.is<Clobber>(); }
144
145 /// Tests if this MemDepResult represents a query that is an instruction
146 /// definition dependency.
147 bool isDef() const { return Value.is<Def>(); }
148
149 /// Tests if this MemDepResult represents a valid local query (Clobber/Def).
150 bool isLocal() const { return isClobber() || isDef(); }
151
152 /// Tests if this MemDepResult represents a query that is transparent to the
153 /// start of the block, but where a non-local hasn't been done.
154 bool isNonLocal() const {
155 return Value.is<Other>() && Value.cast<Other>() == NonLocal;
156 }
157
158 /// Tests if this MemDepResult represents a query that is transparent to the
159 /// start of the function.
160 bool isNonFuncLocal() const {
161 return Value.is<Other>() && Value.cast<Other>() == NonFuncLocal;
162 }
163
164 /// Tests if this MemDepResult represents a query which cannot and/or will
165 /// not be computed.
166 bool isUnknown() const {
167 return Value.is<Other>() && Value.cast<Other>() == Unknown;
168 }
169
170 /// If this is a normal dependency, returns the instruction that is depended
171 /// on. Otherwise, returns null.
173 switch (Value.getTag()) {
174 case Invalid:
175 return Value.cast<Invalid>();
176 case Clobber:
177 return Value.cast<Clobber>();
178 case Def:
179 return Value.cast<Def>();
180 case Other:
181 return nullptr;
182 }
183 llvm_unreachable("Unknown discriminant!");
184 }
185
186 bool operator==(const MemDepResult &M) const { return Value == M.Value; }
187 bool operator!=(const MemDepResult &M) const { return Value != M.Value; }
188 bool operator<(const MemDepResult &M) const { return Value < M.Value; }
189 bool operator>(const MemDepResult &M) const { return Value > M.Value; }
190
191private:
193
194 /// Tests if this is a MemDepResult in its dirty/invalid. state.
195 bool isDirty() const { return Value.is<Invalid>(); }
196
197 static MemDepResult getDirty(Instruction *Inst) {
199 }
200};
201
202/// This is an entry in the NonLocalDepInfo cache.
203///
204/// For each BasicBlock (the BB entry) it keeps a MemDepResult.
206 BasicBlock *BB;
207 MemDepResult Result;
208
209public:
211 : BB(BB), Result(Result) {}
212
213 // This is used for searches.
215
216 // BB is the sort key, it can't be changed.
217 BasicBlock *getBB() const { return BB; }
218
219 void setResult(const MemDepResult &R) { Result = R; }
220
221 const MemDepResult &getResult() const { return Result; }
222
223 bool operator<(const NonLocalDepEntry &RHS) const { return BB < RHS.BB; }
224};
225
226/// This is a result from a NonLocal dependence query.
227///
228/// For each BasicBlock (the BB entry) it keeps a MemDepResult and the
229/// (potentially phi translated) address that was live in the block.
231 NonLocalDepEntry Entry;
232 Value *Address;
233
234public:
236 : Entry(BB, Result), Address(Address) {}
237
238 // BB is the sort key, it can't be changed.
239 BasicBlock *getBB() const { return Entry.getBB(); }
240
241 void setResult(const MemDepResult &R, Value *Addr) {
242 Entry.setResult(R);
243 Address = Addr;
244 }
245
246 const MemDepResult &getResult() const { return Entry.getResult(); }
247
248 /// Returns the address of this pointer in this block.
249 ///
250 /// This can be different than the address queried for the non-local result
251 /// because of phi translation. This returns null if the address was not
252 /// available in a block (i.e. because phi translation failed) or if this is
253 /// a cached result and that address was deleted.
254 ///
255 /// The address is always null for a non-local 'call' dependence.
256 Value *getAddress() const { return Address; }
257};
258
259/// Provides a lazy, caching interface for making common memory aliasing
260/// information queries, backed by LLVM's alias analysis passes.
261///
262/// The dependency information returned is somewhat unusual, but is pragmatic.
263/// If queried about a store or call that might modify memory, the analysis
264/// will return the instruction[s] that may either load from that memory or
265/// store to it. If queried with a load or call that can never modify memory,
266/// the analysis will return calls and stores that might modify the pointer,
267/// but generally does not return loads unless a) they are volatile, or
268/// b) they load from *must-aliased* pointers. Returning a dependence on
269/// must-alias'd pointers instead of all pointers interacts well with the
270/// internal caching mechanism.
272 // A map from instructions to their dependency.
273 using LocalDepMapType = DenseMap<Instruction *, MemDepResult>;
274 LocalDepMapType LocalDeps;
275
276public:
277 using NonLocalDepInfo = std::vector<NonLocalDepEntry>;
278
279private:
280 /// A pair<Value*, bool> where the bool is true if the dependence is a read
281 /// only dependence, false if read/write.
282 using ValueIsLoadPair = PointerIntPair<const Value *, 1, bool>;
283
284 /// This pair is used when caching information for a block.
285 ///
286 /// If the pointer is null, the cache value is not a full query that starts
287 /// at the specified block. If non-null, the bool indicates whether or not
288 /// the contents of the block was skipped.
289 using BBSkipFirstBlockPair = PointerIntPair<BasicBlock *, 1, bool>;
290
291 /// This record is the information kept for each (value, is load) pair.
292 struct NonLocalPointerInfo {
293 /// The pair of the block and the skip-first-block flag.
294 BBSkipFirstBlockPair Pair;
295 /// The results of the query for each relevant block.
296 NonLocalDepInfo NonLocalDeps;
297 /// The maximum size of the dereferences of the pointer.
298 ///
299 /// May be UnknownSize if the sizes are unknown.
301 /// The AA tags associated with dereferences of the pointer.
302 ///
303 /// The members may be null if there are no tags or conflicting tags.
304 AAMDNodes AATags;
305
306 NonLocalPointerInfo() = default;
307 };
308
309 /// Cache storing single nonlocal def for the instruction.
310 /// It is set when nonlocal def would be found in function returning only
311 /// local dependencies.
313 using ReverseNonLocalDefsCacheTy =
315 ReverseNonLocalDefsCacheTy ReverseNonLocalDefsCache;
316
317 /// This map stores the cached results of doing a pointer lookup at the
318 /// bottom of a block.
319 ///
320 /// The key of this map is the pointer+isload bit, the value is a list of
321 /// <bb->result> mappings.
322 using CachedNonLocalPointerInfo =
324 CachedNonLocalPointerInfo NonLocalPointerDeps;
325
326 // A map from instructions to their non-local pointer dependencies.
327 using ReverseNonLocalPtrDepTy =
329 ReverseNonLocalPtrDepTy ReverseNonLocalPtrDeps;
330
331 /// This is the instruction we keep for each cached access that we have for
332 /// an instruction.
333 ///
334 /// The pointer is an owning pointer and the bool indicates whether we have
335 /// any dirty bits in the set.
336 using PerInstNLInfo = std::pair<NonLocalDepInfo, bool>;
337
338 // A map from instructions to their non-local dependencies.
339 using NonLocalDepMapType = DenseMap<Instruction *, PerInstNLInfo>;
340
341 NonLocalDepMapType NonLocalDepsMap;
342
343 // A reverse mapping from dependencies to the dependees. This is
344 // used when removing instructions to keep the cache coherent.
345 using ReverseDepMapType =
347 ReverseDepMapType ReverseLocalDeps;
348
349 // A reverse mapping from dependencies to the non-local dependees.
350 ReverseDepMapType ReverseNonLocalDeps;
351
352 /// Visited map for getNonLocalPointerDependency. Stored here to reuse the
353 /// allocation. Map from block number to Value; second value is epoch to
354 /// avoid clearing the vector for each query.
355 SmallVector<std::pair<Value *, unsigned>, 0> NonLocalPointerDepVisited;
356 unsigned NonLocalPointerDepEpoch = 0;
357
358 /// Current AA implementation, just a cache.
359 AAResults &AA;
360 AssumptionCache &AC;
361 const TargetLibraryInfo &TLI;
362 DominatorTree &DT;
363 PredIteratorCache PredCache;
365
366 unsigned DefaultBlockScanLimit;
367
368 /// Offsets to dependant clobber loads.
369 using ClobberOffsetsMapType = DenseMap<LoadInst *, int32_t>;
370 ClobberOffsetsMapType ClobberOffsets;
371
372public:
374 const TargetLibraryInfo &TLI, DominatorTree &DT,
375 unsigned DefaultBlockScanLimit)
376 : AA(AA), AC(AC), TLI(TLI), DT(DT), EEA(DT),
377 DefaultBlockScanLimit(DefaultBlockScanLimit) {}
378
379 /// Handle invalidation in the new PM.
380 bool invalidate(Function &F, const PreservedAnalyses &PA,
381 FunctionAnalysisManager::Invalidator &Inv);
382
383 /// Some methods limit the number of instructions they will examine.
384 /// The return value of this method is the default limit that will be
385 /// used if no limit is explicitly passed in.
386 unsigned getDefaultBlockScanLimit() const;
387
388 /// Returns the instruction on which a memory operation depends.
389 ///
390 /// See the class comment for more details. It is illegal to call this on
391 /// non-memory instructions.
393
394 /// Perform a full dependency query for the specified call, returning the set
395 /// of blocks that the value is potentially live across.
396 ///
397 /// The returned set of results will include a "NonLocal" result for all
398 /// blocks where the value is live across.
399 ///
400 /// This method assumes the instruction returns a "NonLocal" dependency
401 /// within its own block.
402 ///
403 /// This returns a reference to an internal data structure that may be
404 /// invalidated on the next non-local query or when an instruction is
405 /// removed. Clients must copy this data if they want it around longer than
406 /// that.
408
409 /// Perform a full dependency query for an access to the QueryInst's
410 /// specified memory location, returning the set of instructions that either
411 /// define or clobber the value.
412 ///
413 /// Warning: For a volatile query instruction, the dependencies will be
414 /// accurate, and thus usable for reordering, but it is never legal to
415 /// remove the query instruction.
416 ///
417 /// This method assumes the pointer has a "NonLocal" dependency within
418 /// QueryInst's parent basic block.
421
422 /// Removes an instruction from the dependence analysis, updating the
423 /// dependence of instructions that previously depended on it.
424 void removeInstruction(Instruction *InstToRemove);
425
426 /// Invalidates cached information about the specified pointer, because it
427 /// may be too conservative in memdep.
428 ///
429 /// This is an optional call that can be used when the client detects an
430 /// equivalence between the pointer and some other value and replaces the
431 /// other value with ptr. This can make Ptr available in more places that
432 /// cached info does not necessarily keep.
434
435 /// Clears the PredIteratorCache info.
436 ///
437 /// This needs to be done when the CFG changes, e.g., due to splitting
438 /// critical edges.
440
441 /// Returns the instruction on which a memory location depends.
442 ///
443 /// If isLoad is true, this routine ignores may-aliases with read-only
444 /// operations. If isLoad is false, this routine ignores may-aliases
445 /// with reads from read-only locations. If possible, pass the query
446 /// instruction as well; this function may take advantage of the metadata
447 /// annotated to the query instruction to refine the result. \p Limit
448 /// can be used to set the maximum number of instructions that will be
449 /// examined to find the pointer dependency. On return, it will be set to
450 /// the number of instructions left to examine. If a null pointer is passed
451 /// in, the limit will default to the value of -memdep-block-scan-limit.
452 ///
453 /// Note that this is an uncached query, and thus may be inefficient.
456 BasicBlock *BB,
457 Instruction *QueryInst = nullptr,
458 unsigned *Limit = nullptr);
459
462 BasicBlock *BB,
463 Instruction *QueryInst,
464 unsigned *Limit,
465 BatchAAResults &BatchAA);
466
470 Instruction *QueryInst, unsigned *Limit,
471 BatchAAResults &BatchAA);
472
473 /// This analysis looks for other loads and stores with invariant.group
474 /// metadata and the same pointer operand. Returns Unknown if it does not
475 /// find anything, and Def if it can be assumed that 2 instructions load or
476 /// store the same value and NonLocal which indicate that non-local Def was
477 /// found, which can be retrieved by calling getNonLocalPointerDependency
478 /// with the same queried instruction.
480
481 /// Release memory in caches.
483
484 /// Return the clobber offset to dependent instruction.
485 std::optional<int32_t> getClobberOffset(LoadInst *DepInst) const {
486 const auto Off = ClobberOffsets.find(DepInst);
487 if (Off != ClobberOffsets.end())
488 return Off->getSecond();
489 return std::nullopt;
490 }
491
492private:
493 MemDepResult getCallDependencyFrom(CallBase *Call, bool isReadOnlyCall,
495 BasicBlock *BB);
496 void setNonLocalPointerDepVisited(BasicBlock *BB, Value *V);
497 Value *lookupNonLocalPointerDepVisited(BasicBlock *BB) const;
498 bool getNonLocalPointerDepFromBB(Instruction *QueryInst,
499 const PHITransAddr &Pointer,
500 const MemoryLocation &Loc, bool isLoad,
501 BasicBlock *BB,
503 bool SkipFirstBlock = false,
504 bool IsIncomplete = false);
505 MemDepResult getNonLocalInfoForBlock(Instruction *QueryInst,
506 const MemoryLocation &Loc, bool isLoad,
507 BasicBlock *BB, NonLocalDepInfo *Cache,
508 unsigned NumSortedEntries,
509 BatchAAResults &BatchAA);
510
511 void removeCachedNonLocalPointerDependencies(ValueIsLoadPair P);
512
513 void verifyRemoved(Instruction *Inst) const;
514};
515
516/// An analysis that produces \c MemoryDependenceResults for a function.
517///
518/// This is essentially a no-op because the results are computed entirely
519/// lazily.
521 : public AnalysisInfoMixin<MemoryDependenceAnalysis> {
523
524 static AnalysisKey Key;
525
526 unsigned DefaultBlockScanLimit;
527
528public:
530
532 MemoryDependenceAnalysis(unsigned DefaultBlockScanLimit) : DefaultBlockScanLimit(DefaultBlockScanLimit) { }
533
535};
536
537/// A wrapper analysis pass for the legacy pass manager that exposes a \c
538/// MemoryDepnedenceResults instance.
540 std::optional<MemoryDependenceResults> MemDep;
541
542public:
543 static char ID;
544
547
548 /// Pass Implementation stuff. This doesn't do any analysis eagerly.
549 bool runOnFunction(Function &) override;
550
551 /// Clean up memory in between runs
552 void releaseMemory() override;
553
554 /// Does not modify anything. It uses Value Numbering and Alias Analysis.
555 void getAnalysisUsage(AnalysisUsage &AU) const override;
556
557 MemoryDependenceResults &getMemDep() { return *MemDep; }
558};
559
560} // end namespace llvm
561
562#endif // LLVM_ANALYSIS_MEMORYDEPENDENCEANALYSIS_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool isLoad(int Opcode)
This file defines the DenseMap class.
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:54
This file provides utility analysis objects describing memory locations.
#define P(N)
This file defines the PointerIntPair class.
This file defines the SmallPtrSet class.
Value * RHS
Represent the analysis usage information of a pass.
A cache of @llvm.assume calls within a function.
LLVM Basic Block Representation.
Definition BasicBlock.h:62
InstListType::iterator iterator
Instruction iterators...
Definition BasicBlock.h:170
This class is a wrapper over an AAResults, and it is intended to be used only when there are no IR ch...
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:159
Context-sensitive CaptureAnalysis provider, which computes and caches the earliest common dominator c...
FunctionPass(char &pid)
Definition Pass.h:316
An instruction for reading from memory.
static constexpr LocationSize afterPointer()
Any location after the base pointer (but still within the underlying object).
A memory dependence query can return one of three different answers.
bool isClobber() const
Tests if this MemDepResult represents a query that is an instruction clobber dependency.
bool operator!=(const MemDepResult &M) const
bool isNonLocal() const
Tests if this MemDepResult represents a query that is transparent to the start of the block,...
static MemDepResult getNonLocal()
bool isNonFuncLocal() const
Tests if this MemDepResult represents a query that is transparent to the start of the function.
bool operator>(const MemDepResult &M) const
static MemDepResult getClobber(Instruction *Inst)
bool isDef() const
Tests if this MemDepResult represents a query that is an instruction definition dependency.
bool operator==(const MemDepResult &M) const
static MemDepResult getUnknown()
bool operator<(const MemDepResult &M) const
MemDepResult()=default
bool isLocal() const
Tests if this MemDepResult represents a valid local query (Clobber/Def).
bool isUnknown() const
Tests if this MemDepResult represents a query which cannot and/or will not be computed.
static MemDepResult getNonFuncLocal()
static MemDepResult getDef(Instruction *Inst)
get methods: These are static ctor methods for creating various MemDepResult kinds.
Instruction * getInst() const
If this is a normal dependency, returns the instruction that is depended on.
MemoryDependenceResults run(Function &F, FunctionAnalysisManager &AM)
MemoryDependenceAnalysis(unsigned DefaultBlockScanLimit)
Provides a lazy, caching interface for making common memory aliasing information queries,...
MemDepResult getSimplePointerDependencyFrom(const MemoryLocation &MemLoc, bool isLoad, BasicBlock::iterator ScanIt, BasicBlock *BB, Instruction *QueryInst, unsigned *Limit, BatchAAResults &BatchAA)
std::vector< NonLocalDepEntry > NonLocalDepInfo
void invalidateCachedPredecessors()
Clears the PredIteratorCache info.
void invalidateCachedPointerInfo(Value *Ptr)
Invalidates cached information about the specified pointer, because it may be too conservative in mem...
MemoryDependenceResults(AAResults &AA, AssumptionCache &AC, const TargetLibraryInfo &TLI, DominatorTree &DT, unsigned DefaultBlockScanLimit)
MemDepResult getPointerDependencyFrom(const MemoryLocation &Loc, bool isLoad, BasicBlock::iterator ScanIt, BasicBlock *BB, Instruction *QueryInst=nullptr, unsigned *Limit=nullptr)
Returns the instruction on which a memory location depends.
std::optional< int32_t > getClobberOffset(LoadInst *DepInst) const
Return the clobber offset to dependent instruction.
void removeInstruction(Instruction *InstToRemove)
Removes an instruction from the dependence analysis, updating the dependence of instructions that pre...
MemDepResult getInvariantGroupPointerDependency(LoadInst *LI, BasicBlock *BB)
This analysis looks for other loads and stores with invariant.group metadata and the same pointer ope...
unsigned getDefaultBlockScanLimit() const
Some methods limit the number of instructions they will examine.
MemDepResult getDependency(Instruction *QueryInst)
Returns the instruction on which a memory operation depends.
const NonLocalDepInfo & getNonLocalCallDependency(CallBase *QueryCall)
Perform a full dependency query for the specified call, returning the set of blocks that the value is...
void getNonLocalPointerDependency(Instruction *QueryInst, SmallVectorImpl< NonLocalDepResult > &Result)
Perform a full dependency query for an access to the QueryInst's specified memory location,...
void releaseMemory()
Release memory in caches.
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &Inv)
Handle invalidation in the new PM.
bool runOnFunction(Function &) override
Pass Implementation stuff. This doesn't do any analysis eagerly.
void getAnalysisUsage(AnalysisUsage &AU) const override
Does not modify anything. It uses Value Numbering and Alias Analysis.
void releaseMemory() override
Clean up memory in between runs.
Representation for a specific memory location.
This is an entry in the NonLocalDepInfo cache.
void setResult(const MemDepResult &R)
NonLocalDepEntry(BasicBlock *BB, MemDepResult Result)
bool operator<(const NonLocalDepEntry &RHS) const
const MemDepResult & getResult() const
This is a result from a NonLocal dependence query.
NonLocalDepResult(BasicBlock *BB, MemDepResult Result, Value *Address)
const MemDepResult & getResult() const
Value * getAddress() const
Returns the address of this pointer in this block.
void setResult(const MemDepResult &R, Value *Addr)
PHITransAddr - An address value which tracks and handles phi translation.
PointerIntPair - This class implements a pair of a pointer and small integer.
A sum type over pointer-like types.
PredIteratorCache - This class is an extremely trivial cache for predecessor iterator queries.
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Provides information about what library functions are available for the current target.
LLVM Value Representation.
Definition Value.h:75
CallInst * Call
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Abstract Attribute helper functions.
Definition Attributor.h:165
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
Definition InstrProf.h:137
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A collection of metadata nodes that might be associated with a memory access used by the alias-analys...
Definition Metadata.h:763
A CRTP mix-in that provides informational APIs needed for analysis passes.
Definition PassManager.h:93
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition Analysis.h:29
A compile time pair of an integer tag and the pointer-like type which it indexes within a sum type.