aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/MemoryDependenceAnalysis.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-09 01:59:31 +0000
committerChris Lattner <sabre@nondot.org>2009-12-09 01:59:31 +0000
commit05e15f8897bd949f9d4bce073d53ed3256c71e2b (patch)
treee9f03085680ca3f56f93dd7899cda45e972b090b /include/llvm/Analysis/MemoryDependenceAnalysis.h
parent7bd6478cd6a1264f884b46f3694af3a68a6fab0a (diff)
downloadexternal_llvm-05e15f8897bd949f9d4bce073d53ed3256c71e2b.zip
external_llvm-05e15f8897bd949f9d4bce073d53ed3256c71e2b.tar.gz
external_llvm-05e15f8897bd949f9d4bce073d53ed3256c71e2b.tar.bz2
Switch GVN and memdep to use PHITransAddr, which correctly handles
phi translation of complex expressions like &A[i+1]. This has the following benefits: 1. The phi translation logic is all contained in its own class with a strong interface and verification that it is self consistent. 2. The logic is more correct than before. Previously, if intermediate expressions got PHI translated, we'd miss the update and scan for the wrong pointers in predecessor blocks. @phi_trans2 is a testcase for this. 3. We have a lot less code in memdep. We can handle phi translation across blocks of things like @phi_trans3, which is pretty insane :). This patch should fix the miscompiles of 255.vortex, and I tested it with a bootstrap of llvm-gcc, llvm-test and dejagnu of course. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/MemoryDependenceAnalysis.h')
-rw-r--r--include/llvm/Analysis/MemoryDependenceAnalysis.h26
1 files changed, 2 insertions, 24 deletions
diff --git a/include/llvm/Analysis/MemoryDependenceAnalysis.h b/include/llvm/Analysis/MemoryDependenceAnalysis.h
index b55be29..b46563b 100644
--- a/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ b/include/llvm/Analysis/MemoryDependenceAnalysis.h
@@ -31,6 +31,7 @@ namespace llvm {
class MemoryDependenceAnalysis;
class PredIteratorCache;
class DominatorTree;
+ class PHITransAddr;
/// MemDepResult - A memory dependence query can return one of three different
/// answers, described below.
@@ -245,29 +246,6 @@ namespace llvm {
BasicBlock *BB,
SmallVectorImpl<NonLocalDepEntry> &Result);
- /// GetPHITranslatedValue - Find an available version of the specified value
- /// PHI translated across the specified edge. If MemDep isn't able to
- /// satisfy this request, it returns null.
- Value *GetPHITranslatedValue(Value *V,
- BasicBlock *CurBB, BasicBlock *PredBB,
- const TargetData *TD) const;
-
- /// GetAvailablePHITranslatedValue - Return the value computed by
- /// PHITranslatePointer if it dominates PredBB, otherwise return null.
- Value *GetAvailablePHITranslatedValue(Value *V,
- BasicBlock *CurBB, BasicBlock *PredBB,
- const TargetData *TD,
- const DominatorTree &DT) const;
-
- /// InsertPHITranslatedPointer - Insert a computation of the PHI translated
- /// version of 'V' for the edge PredBB->CurBB into the end of the PredBB
- /// block. All newly created instructions are added to the NewInsts list.
- Value *InsertPHITranslatedPointer(Value *V,
- BasicBlock *CurBB, BasicBlock *PredBB,
- const TargetData *TD,
- const DominatorTree &DT,
- SmallVectorImpl<Instruction*> &NewInsts) const;
-
/// removeInstruction - Remove an instruction from the dependence analysis,
/// updating the dependence of instructions that previously depended on it.
void removeInstruction(Instruction *InstToRemove);
@@ -288,7 +266,7 @@ namespace llvm {
MemDepResult getCallSiteDependencyFrom(CallSite C, bool isReadOnlyCall,
BasicBlock::iterator ScanIt,
BasicBlock *BB);
- bool getNonLocalPointerDepFromBB(Value *Pointer, uint64_t Size,
+ bool getNonLocalPointerDepFromBB(const PHITransAddr &Pointer, uint64_t Size,
bool isLoad, BasicBlock *BB,
SmallVectorImpl<NonLocalDepEntry> &Result,
DenseMap<BasicBlock*, Value*> &Visited,