diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-12-07 00:21:18 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-12-07 00:21:18 +0000 |
| commit | f5891941b46720a530bcc6041142e451b5f4dde7 (patch) | |
| tree | bf283d6433c3684076252f361b41574ce0a8dc62 /llvm/lib/Analysis | |
| parent | 0d8f0ba6ed94ee5095040dad98b5e4d1423a1751 (diff) | |
| download | bcm5719-llvm-f5891941b46720a530bcc6041142e451b5f4dde7.tar.gz bcm5719-llvm-f5891941b46720a530bcc6041142e451b5f4dde7.zip | |
remove the ability to get memdep info for vaarg. I don't think the
original impl was correct and noone actually makes the query anyway.
llvm-svn: 60639
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index 44119d7b6b7..24e45520c25 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -109,6 +109,10 @@ getCallSiteDependency(CallSite CS, BasicBlock::iterator ScanIt, BasicBlock *BB) MemDepResult MemoryDependenceAnalysis:: getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt, BasicBlock *BB) { + // The first instruction in a block is always non-local. + if (ScanIt == BB->begin()) + return MemDepResult::getNonLocal(); + // Get the pointer value for which dependence will be determined Value *MemPtr = 0; uint64_t MemSize = 0; @@ -122,17 +126,16 @@ getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt, MemPtr = LI->getPointerOperand(); MemSize = TD->getTypeStoreSize(LI->getType()); MemVolatile = LI->isVolatile(); - } else if (VAArgInst* V = dyn_cast<VAArgInst>(QueryInst)) { - MemPtr = V->getOperand(0); - MemSize = TD->getTypeStoreSize(V->getType()); } else if (FreeInst* F = dyn_cast<FreeInst>(QueryInst)) { MemPtr = F->getPointerOperand(); // FreeInsts erase the entire structure, not just a field. MemSize = ~0UL; - } else { - assert((isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) && - "Can only get dependency info for memory instructions!"); + } else if (isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) { return getCallSiteDependency(CallSite::get(QueryInst), ScanIt, BB); + } else { + // Otherwise, this is a vaarg or non-memory instruction, just return a + // clobber dependency on the previous inst. + return MemDepResult::getClobber(--ScanIt); } // Walk backwards through the basic block, looking for dependencies |

