diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-12-07 01:21:14 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-12-07 01:21:14 +0000 |
| commit | ed494f791edbebb1398a7d2d84c505c1e29ef7b0 (patch) | |
| tree | ae61f7cb36499db4e1e0f707e634f9c731d97196 /llvm/lib/Analysis | |
| parent | b3582b939e2bb99d25de4908576b49d43490f8cf (diff) | |
| download | bcm5719-llvm-ed494f791edbebb1398a7d2d84c505c1e29ef7b0.tar.gz bcm5719-llvm-ed494f791edbebb1398a7d2d84c505c1e29ef7b0.zip | |
make clients have to know how to call getCallSiteDependencyFrom
instead of making getDependencyFrom do it.
llvm-svn: 60647
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index 5a6db31a784..415766a5a15 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -139,6 +139,7 @@ getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt, // FreeInsts erase the entire structure, not just a field. MemSize = ~0UL; } else if (isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) { + assert(0 && "Should use getCallSiteDependencyFrom!"); return getCallSiteDependencyFrom(CallSite::get(QueryInst), ScanIt, BB); } else { // Otherwise, this is a vaarg or non-memory instruction, just return a @@ -233,7 +234,11 @@ MemDepResult MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) { } // Do the scan. - LocalCache = getDependencyFrom(QueryInst, ScanPos, QueryInst->getParent()); + if (!isa<CallInst>(QueryInst) && !isa<InvokeInst>(QueryInst)) + LocalCache = getDependencyFrom(QueryInst, ScanPos, QueryInst->getParent()); + else + LocalCache = getCallSiteDependencyFrom(CallSite::get(QueryInst), ScanPos, + QueryInst->getParent()); // Remember the result! if (Instruction *I = LocalCache.getInst()) @@ -341,7 +346,12 @@ MemoryDependenceAnalysis::getNonLocalDependency(Instruction *QueryInst) { } // Find out if this block has a local dependency for QueryInst. - MemDepResult Dep = getDependencyFrom(QueryInst, ScanPos, DirtyBB); + MemDepResult Dep; + if (!isa<CallInst>(QueryInst) && !isa<InvokeInst>(QueryInst)) + Dep = getDependencyFrom(QueryInst, ScanPos, DirtyBB); + else + Dep = getCallSiteDependencyFrom(CallSite::get(QueryInst), ScanPos, + DirtyBB); // If we had a dirty entry for the block, update it. Otherwise, just add // a new entry. @@ -368,6 +378,7 @@ MemoryDependenceAnalysis::getNonLocalDependency(Instruction *QueryInst) { return Cache; } + /// removeInstruction - Remove an instruction from the dependence analysis, /// updating the dependence of instructions that previously depended on it. /// This method attempts to keep the cache coherent using the reverse map. |

