From 3b35a4d21bee4565e88f745105429e908b80fbb7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 7 Dec 2008 01:21:14 +0000 Subject: make clients have to know how to call getCallSiteDependencyFrom instead of making getDependencyFrom do it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60647 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/MemoryDependenceAnalysis.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index 5a6db31..415766a 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/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(QueryInst) || isa(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(QueryInst) && !isa(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(QueryInst) && !isa(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. -- cgit v1.1