summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-09-22 21:41:02 +0000
committerDan Gohman <gohman@apple.com>2010-09-22 21:41:02 +0000
commitc1ac0d7623f4f2047b4ab86bd5a60a9e19432b38 (patch)
tree9682b6ecdeec514c8b142c4f7dcd15cef9f97e55 /include
parentbe90c3a0ea66fb05dfe72fbe42cca2713c6c8b1a (diff)
downloadllvm-c1ac0d7623f4f2047b4ab86bd5a60a9e19432b38.tar.gz
llvm-c1ac0d7623f4f2047b4ab86bd5a60a9e19432b38.tar.bz2
llvm-c1ac0d7623f4f2047b4ab86bd5a60a9e19432b38.tar.xz
Teach memdep about TBAA tags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114588 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/MemoryDependenceAnalysis.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h
index 0e3b0f8284..dc5aadf6d5 100644
--- a/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h
@@ -17,6 +17,7 @@
#include "llvm/BasicBlock.h"
#include "llvm/Pass.h"
#include "llvm/Support/ValueHandle.h"
+#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/OwningPtr.h"
@@ -220,11 +221,23 @@ namespace llvm {
/// or not the contents of the block was skipped.
typedef PointerIntPair<BasicBlock*, 1, bool> BBSkipFirstBlockPair;
+ /// NonLocalPointerInfo - This record is the information kept for each
+ /// (value, is load) pair.
+ struct NonLocalPointerInfo {
+ /// Pair - The pair of the block and the skip-first-block flag.
+ BBSkipFirstBlockPair Pair;
+ /// NonLocalDeps - The results of the query for each relevant block.
+ NonLocalDepInfo NonLocalDeps;
+ /// TBAATag - The TBAA tag associated with dereferences of the
+ /// pointer. May be null if there are no tags or conflicting tags.
+ MDNode *TBAATag;
+ };
+
/// CachedNonLocalPointerInfo - This map stores the cached results of doing
/// a pointer lookup at the bottom of a block. The key of this map is the
/// pointer+isload bit, the value is a list of <bb->result> mappings.
- typedef DenseMap<ValueIsLoadPair, std::pair<BBSkipFirstBlockPair,
- NonLocalDepInfo> > CachedNonLocalPointerInfo;
+ typedef DenseMap<ValueIsLoadPair,
+ NonLocalPointerInfo> CachedNonLocalPointerInfo;
CachedNonLocalPointerInfo NonLocalPointerDeps;
// A map from instructions to their non-local pointer dependencies.
@@ -297,9 +310,17 @@ namespace llvm {
/// set of instructions that either define or clobber the value.
///
/// This method assumes the pointer has a "NonLocal" dependency within BB.
+ void getNonLocalPointerDependency(const AliasAnalysis::Location &Loc,
+ bool isLoad, BasicBlock *BB,
+ SmallVectorImpl<NonLocalDepResult> &Result);
+
+ /// getNonLocalPointerDependence - A convenience wrapper.
void getNonLocalPointerDependency(Value *Pointer, bool isLoad,
BasicBlock *BB,
- SmallVectorImpl<NonLocalDepResult> &Result);
+ SmallVectorImpl<NonLocalDepResult> &Result){
+ return getNonLocalPointerDependency(AliasAnalysis::Location(Pointer),
+ isLoad, BB, Result);
+ }
/// removeInstruction - Remove an instruction from the dependence analysis,
/// updating the dependence of instructions that previously depended on it.
@@ -319,19 +340,20 @@ namespace llvm {
void invalidateCachedPredecessors();
private:
- MemDepResult getPointerDependencyFrom(Value *Pointer, uint64_t MemSize,
+ MemDepResult getPointerDependencyFrom(const AliasAnalysis::Location &Loc,
bool isLoad,
BasicBlock::iterator ScanIt,
BasicBlock *BB);
MemDepResult getCallSiteDependencyFrom(CallSite C, bool isReadOnlyCall,
BasicBlock::iterator ScanIt,
BasicBlock *BB);
- bool getNonLocalPointerDepFromBB(const PHITransAddr &Pointer, uint64_t Size,
+ bool getNonLocalPointerDepFromBB(const PHITransAddr &Pointer,
+ const AliasAnalysis::Location &Loc,
bool isLoad, BasicBlock *BB,
SmallVectorImpl<NonLocalDepResult> &Result,
DenseMap<BasicBlock*, Value*> &Visited,
bool SkipFirstBlock = false);
- MemDepResult GetNonLocalInfoForBlock(Value *Pointer, uint64_t PointeeSize,
+ MemDepResult GetNonLocalInfoForBlock(const AliasAnalysis::Location &Loc,
bool isLoad, BasicBlock *BB,
NonLocalDepInfo *Cache,
unsigned NumSortedEntries);