mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 05:29:23 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60639 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
aea5a2a22a
commit
84b9a56d11
@ -109,6 +109,10 @@ getCallSiteDependency(CallSite CS, BasicBlock::iterator ScanIt, BasicBlock *BB)
|
|||||||
MemDepResult MemoryDependenceAnalysis::
|
MemDepResult MemoryDependenceAnalysis::
|
||||||
getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt,
|
getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt,
|
||||||
BasicBlock *BB) {
|
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
|
// Get the pointer value for which dependence will be determined
|
||||||
Value *MemPtr = 0;
|
Value *MemPtr = 0;
|
||||||
uint64_t MemSize = 0;
|
uint64_t MemSize = 0;
|
||||||
@ -122,17 +126,16 @@ getDependencyFrom(Instruction *QueryInst, BasicBlock::iterator ScanIt,
|
|||||||
MemPtr = LI->getPointerOperand();
|
MemPtr = LI->getPointerOperand();
|
||||||
MemSize = TD->getTypeStoreSize(LI->getType());
|
MemSize = TD->getTypeStoreSize(LI->getType());
|
||||||
MemVolatile = LI->isVolatile();
|
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)) {
|
} else if (FreeInst* F = dyn_cast<FreeInst>(QueryInst)) {
|
||||||
MemPtr = F->getPointerOperand();
|
MemPtr = F->getPointerOperand();
|
||||||
// FreeInsts erase the entire structure, not just a field.
|
// FreeInsts erase the entire structure, not just a field.
|
||||||
MemSize = ~0UL;
|
MemSize = ~0UL;
|
||||||
} else {
|
} else if (isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) {
|
||||||
assert((isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) &&
|
|
||||||
"Can only get dependency info for memory instructions!");
|
|
||||||
return getCallSiteDependency(CallSite::get(QueryInst), ScanIt, BB);
|
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
|
// Walk backwards through the basic block, looking for dependencies
|
||||||
|
Loading…
x
Reference in New Issue
Block a user