|
LLVM
4.0.0
|
A MemorySSAWalker that does AA walks and caching of lookups to disambiguate accesses. More...
Public Member Functions | |
| CachingWalker (MemorySSA *, AliasAnalysis *, DominatorTree *) | |
| ~CachingWalker () override | |
| MemoryAccess * | getClobberingMemoryAccess (MemoryAccess *) override |
| Does the same thing as getClobberingMemoryAccess(const Instruction *I), but takes a MemoryAccess instead of an Instruction. More... | |
| MemoryAccess * | getClobberingMemoryAccess (MemoryAccess *, const MemoryLocation &) override |
| Given a potentially clobbering memory access and a new location, calling this will give you the nearest dominating clobbering MemoryAccess (by skipping non-aliasing def links). More... | |
| void | invalidateInfo (MemoryAccess *) override |
| Given a memory access, invalidate anything this walker knows about that access. More... | |
| void | setAutoResetWalker (bool AutoReset) |
| Whether we call resetClobberWalker() after each time we actually walk to answer a clobber query. More... | |
| void | resetClobberWalker () |
| Drop the walker's persistent data structures. More... | |
| void | verify (const MemorySSA *MSSA) override |
Public Member Functions inherited from llvm::MemorySSAWalker | |
| MemorySSAWalker (MemorySSA *) | |
| virtual | ~MemorySSAWalker () |
| MemoryAccess * | getClobberingMemoryAccess (const Instruction *I) |
| Given a memory Mod/Ref/ModRef'ing instruction, calling this will give you the nearest dominating MemoryAccess that Mod's the location the instruction accesses (by skipping any def which AA can prove does not alias the location(s) accessed by the instruction given). More... | |
Additional Inherited Members | |
Public Types inherited from llvm::MemorySSAWalker | |
| using | MemoryAccessSet = SmallVector< MemoryAccess *, 8 > |
Protected Attributes inherited from llvm::MemorySSAWalker | |
| MemorySSA * | MSSA |
A MemorySSAWalker that does AA walks and caching of lookups to disambiguate accesses.
FIXME: The current implementation of this can take quadratic space in rare cases. This can be fixed, but it is something to note until it is fixed.
In order to trigger this behavior, you need to store to N distinct locations (that AA can prove don't alias), perform M stores to other memory locations that AA can prove don't alias any of the initial N locations, and then load from all of the N locations. In this case, we insert M cache entries for each of the N loads.
For example: define i32 () { a = alloca i32, align 4 b = alloca i32, align 4 store i32 0, i32* a, align 4 store i32 0, i32* b, align 4
; Insert M stores to other memory that doesn't alias a or b here
c = load i32, i32* a, align 4 ; Caches M entries in ; CachedUpwardsClobberingAccess for the ; MemoryLocation a d = load i32, i32* b, align 4 ; Caches M entries in ; CachedUpwardsClobberingAccess for the ; MemoryLocation b
; For completeness' sake, loading a or b again would not cache another ; M entries. r = add i32 c, d ret i32 r }
Definition at line 1085 of file MemorySSA.cpp.
| llvm::MemorySSA::CachingWalker::CachingWalker | ( | MemorySSA * | M, |
| AliasAnalysis * | A, | ||
| DominatorTree * | D | ||
| ) |
Definition at line 2146 of file MemorySSA.cpp.
|
override |
Definition at line 2150 of file MemorySSA.cpp.
|
overridevirtual |
Does the same thing as getClobberingMemoryAccess(const Instruction *I), but takes a MemoryAccess instead of an Instruction.
Implements llvm::MemorySSAWalker.
Definition at line 2236 of file MemorySSA.cpp.
References llvm::dbgs(), DEBUG, llvm::dyn_cast(), llvm::MemorySSA::getLiveOnEntryDef(), llvm::Instruction::isFenceLike(), and llvm::MemorySSA::isLiveOnEntryDef().
|
overridevirtual |
Given a potentially clobbering memory access and a new location, calling this will give you the nearest dominating clobbering MemoryAccess (by skipping non-aliasing def links).
This version of the function is mainly used to disambiguate phi translated pointers, where the value of a pointer may have changed from the initial memory access. Note that this expects to be handed either a MemoryUse, or an already potentially clobbering access. Unlike the above API, if given a MemoryDef that clobbers the pointer as the starting access, it will return that MemoryDef, whereas the above would return the clobber starting from the use side of the memory def.
Implements llvm::MemorySSAWalker.
Definition at line 2196 of file MemorySSA.cpp.
References llvm::dbgs(), DEBUG, I, llvm::Instruction::isFenceLike(), and llvm::MemorySSA::isLiveOnEntryDef().
|
overridevirtual |
Given a memory access, invalidate anything this walker knows about that access.
This API is used by walkers that store information to perform basic cache invalidation. This will be called by MemorySSA at appropriate times for the walker it uses or returns.
Reimplemented from llvm::MemorySSAWalker.
Definition at line 2152 of file MemorySSA.cpp.
|
inline |
Drop the walker's persistent data structures.
At the moment, this means "drop the walker's cache of BasicBlocks -> earliest-MemoryAccess-we-can-optimize-to". This is necessary if we're going to have DT updates, if we remove MemoryAccesses, etc.
Definition at line 1111 of file MemorySSA.cpp.
|
inline |
Whether we call resetClobberWalker() after each time we actually walk to answer a clobber query.
Definition at line 1105 of file MemorySSA.cpp.
Reimplemented from llvm::MemorySSAWalker.
Definition at line 1113 of file MemorySSA.cpp.
References llvm::MemorySSAWalker::verify().
1.8.6