aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/MemoryDependenceAnalysis.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-29 03:22:12 +0000
committerChris Lattner <sabre@nondot.org>2008-11-29 03:22:12 +0000
commit7f52422a3c821c1deb7171808ffcf83386970791 (patch)
tree155c25a6589b25abfc2e99b8f75dab2f95ad789c /include/llvm/Analysis/MemoryDependenceAnalysis.h
parent4c724006256032e827177afeae04ea62436796e7 (diff)
Now that DepType is private, we can start cleaning up some of its uses:
Document the Dirty value more precisely, use it for the uninitialized DepResultTy value. Change reverse mappings to be from an instruction* instead of DepResultTy, and stop tracking other forms. This makes it more clear that we only care about the instruction cases. Eliminate a DepResultTy,bool pair by using Dirty in the local case as well, shrinking the map and simplifying the code. This speeds up GVN by ~3% on 403.gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60232 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/MemoryDependenceAnalysis.h')
-rw-r--r--include/llvm/Analysis/MemoryDependenceAnalysis.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h
index 98835f975d..618a18ba92 100644
--- a/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h
@@ -83,9 +83,24 @@ namespace llvm {
/// DepType - This enum is used to indicate what flavor of dependence this
/// is. If the type is Normal, there is an associated instruction pointer.
enum DepType {
+ /// Dirty - Entries with this marker may come in two forms, depending on
+ /// whether they are in a LocalDeps map or NonLocalDeps map. In either
+ /// case, this marker indicates that the cached value has been invalidated
+ /// by a removeInstruction call.
+ ///
+ /// If in the LocalDeps map, the Instruction field will indicate the place
+ /// in the current block to start scanning. If in the non-localdeps map,
+ /// the instruction will be null.
+ ///
+ /// In a default-constructed DepResultTy object, the type will be Dirty
+ /// and the instruction pointer will be null.
+ ///
+ /// FIXME: Why not add a scanning point for the non-local deps map???
+ Dirty = 0,
+
/// Normal - This is a normal instruction dependence. The pointer member
/// of the DepResultTy pair holds the instruction.
- Normal = 0,
+ Normal,
/// None - This dependence type indicates that the query does not depend
/// on any instructions, either because it scanned to the start of the
@@ -96,18 +111,12 @@ namespace llvm {
/// NonLocal - This marker indicates that the query has no dependency in
/// the specified block. To find out more, the client should query other
/// predecessor blocks.
- NonLocal,
-
- /// Dirty - This is an internal marker indicating that that a cache entry
- /// is dirty.
- Dirty
+ NonLocal
};
typedef PointerIntPair<Instruction*, 2, DepType> DepResultTy;
- // A map from instructions to their dependency, with a boolean
- // flags for whether this mapping is confirmed or not.
- typedef DenseMap<Instruction*,
- std::pair<DepResultTy, bool> > LocalDepMapType;
+ // A map from instructions to their dependency.
+ typedef DenseMap<Instruction*, DepResultTy> LocalDepMapType;
LocalDepMapType LocalDeps;
// A map from instructions to their non-local dependencies.
@@ -118,7 +127,7 @@ namespace llvm {
// A reverse mapping from dependencies to the dependees. This is
// used when removing instructions to keep the cache coherent.
- typedef DenseMap<DepResultTy,
+ typedef DenseMap<Instruction*,
SmallPtrSet<Instruction*, 4> > reverseDepMapType;
reverseDepMapType reverseDep;