mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 21:34:23 +00:00
calls never depend on allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60268 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
237a828745
commit
cfbb634225
@ -63,15 +63,6 @@ getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt,
|
|||||||
if (StoreInst *S = dyn_cast<StoreInst>(Inst)) {
|
if (StoreInst *S = dyn_cast<StoreInst>(Inst)) {
|
||||||
Pointer = S->getPointerOperand();
|
Pointer = S->getPointerOperand();
|
||||||
PointerSize = TD.getTypeStoreSize(S->getOperand(0)->getType());
|
PointerSize = TD.getTypeStoreSize(S->getOperand(0)->getType());
|
||||||
} else if (AllocationInst *AI = dyn_cast<AllocationInst>(Inst)) {
|
|
||||||
Pointer = AI;
|
|
||||||
if (ConstantInt *C = dyn_cast<ConstantInt>(AI->getArraySize()))
|
|
||||||
// Use ABI size (size between elements), not store size (size of one
|
|
||||||
// element without padding).
|
|
||||||
PointerSize = C->getZExtValue() *
|
|
||||||
TD.getABITypeSize(AI->getAllocatedType());
|
|
||||||
else
|
|
||||||
PointerSize = ~0UL;
|
|
||||||
} else if (VAArgInst *V = dyn_cast<VAArgInst>(Inst)) {
|
} else if (VAArgInst *V = dyn_cast<VAArgInst>(Inst)) {
|
||||||
Pointer = V->getOperand(0);
|
Pointer = V->getOperand(0);
|
||||||
PointerSize = TD.getTypeStoreSize(V->getType());
|
PointerSize = TD.getTypeStoreSize(V->getType());
|
||||||
@ -85,8 +76,10 @@ getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt,
|
|||||||
AliasAnalysis::DoesNotAccessMemory)
|
AliasAnalysis::DoesNotAccessMemory)
|
||||||
continue;
|
continue;
|
||||||
return DepResultTy(Inst, Normal);
|
return DepResultTy(Inst, Normal);
|
||||||
} else
|
} else {
|
||||||
|
// Non-memory instruction.
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (AA.getModRefInfo(C, Pointer, PointerSize) != AliasAnalysis::NoModRef)
|
if (AA.getModRefInfo(C, Pointer, PointerSize) != AliasAnalysis::NoModRef)
|
||||||
return DepResultTy(Inst, Normal);
|
return DepResultTy(Inst, Normal);
|
||||||
@ -141,8 +134,8 @@ getDependencyFromInternal(Instruction *QueryInst, BasicBlock::iterator ScanIt,
|
|||||||
(isa<StoreInst>(Inst) && cast<StoreInst>(Inst)->isVolatile())))
|
(isa<StoreInst>(Inst) && cast<StoreInst>(Inst)->isVolatile())))
|
||||||
return DepResultTy(Inst, Normal);
|
return DepResultTy(Inst, Normal);
|
||||||
|
|
||||||
// MemDep is broken w.r.t. loads: it says that two loads of the same pointer
|
// Values depend on loads if the pointers are must aliased. This means that
|
||||||
// depend on each other. :(
|
// a load depends on another must aliased load from the same value.
|
||||||
if (LoadInst *L = dyn_cast<LoadInst>(Inst)) {
|
if (LoadInst *L = dyn_cast<LoadInst>(Inst)) {
|
||||||
Value *Pointer = L->getPointerOperand();
|
Value *Pointer = L->getPointerOperand();
|
||||||
uint64_t PointerSize = TD.getTypeStoreSize(L->getType());
|
uint64_t PointerSize = TD.getTypeStoreSize(L->getType());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user