diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-30 01:44:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-30 01:44:00 +0000 |
commit | cfbb634225007b2eddfbfcbf2adff2291b9c03bd (patch) | |
tree | 3a6352efafd58c5a58677c9a059682ddc90d1863 /lib | |
parent | 237a8287454389a5b940e18c1efb2201fc443208 (diff) | |
download | external_llvm-cfbb634225007b2eddfbfcbf2adff2291b9c03bd.zip external_llvm-cfbb634225007b2eddfbfcbf2adff2291b9c03bd.tar.gz external_llvm-cfbb634225007b2eddfbfcbf2adff2291b9c03bd.tar.bz2 |
calls never depend on allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60268 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index e135f11..0a71b30 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -63,15 +63,6 @@ getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt, if (StoreInst *S = dyn_cast<StoreInst>(Inst)) { Pointer = S->getPointerOperand(); 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)) { Pointer = V->getOperand(0); PointerSize = TD.getTypeStoreSize(V->getType()); @@ -85,8 +76,10 @@ getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt, AliasAnalysis::DoesNotAccessMemory) continue; return DepResultTy(Inst, Normal); - } else + } else { + // Non-memory instruction. continue; + } if (AA.getModRefInfo(C, Pointer, PointerSize) != AliasAnalysis::NoModRef) return DepResultTy(Inst, Normal); @@ -141,8 +134,8 @@ getDependencyFromInternal(Instruction *QueryInst, BasicBlock::iterator ScanIt, (isa<StoreInst>(Inst) && cast<StoreInst>(Inst)->isVolatile()))) return DepResultTy(Inst, Normal); - // MemDep is broken w.r.t. loads: it says that two loads of the same pointer - // depend on each other. :( + // Values depend on loads if the pointers are must aliased. This means that + // a load depends on another must aliased load from the same value. if (LoadInst *L = dyn_cast<LoadInst>(Inst)) { Value *Pointer = L->getPointerOperand(); uint64_t PointerSize = TD.getTypeStoreSize(L->getType()); |