aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-29 09:15:21 +0000
committerChris Lattner <sabre@nondot.org>2008-11-29 09:15:21 +0000
commit00314b3d84252555e45ca147521bbfb0e8cc86d6 (patch)
tree15361a899082f96e943bce9575914f0ffcd346dd /lib/Analysis/MemoryDependenceAnalysis.cpp
parenta161ab06d9e194bbc048b04998e64a8f8a14e49c (diff)
rename some variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index fdc14bdb19..2f954f7a24 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -97,35 +97,35 @@ getCallSiteDependency(CallSite C, BasicBlock::iterator ScanIt,
Instruction *Inst = --ScanIt;
// If this inst is a memory op, get the pointer it accessed
- Value* pointer = 0;
- uint64_t pointerSize = 0;
- 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()))
- pointerSize = C->getZExtValue() *
+ Value *Pointer = 0;
+ uint64_t PointerSize = 0;
+ 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()))
+ PointerSize = C->getZExtValue() *
TD.getTypeStoreSize(AI->getAllocatedType());
else
- pointerSize = ~0UL;
- } else if (VAArgInst* V = dyn_cast<VAArgInst>(Inst)) {
- pointer = V->getOperand(0);
- pointerSize = TD.getTypeStoreSize(V->getType());
- } else if (FreeInst* F = dyn_cast<FreeInst>(Inst)) {
- pointer = F->getPointerOperand();
+ PointerSize = ~0UL;
+ } else if (VAArgInst *V = dyn_cast<VAArgInst>(Inst)) {
+ Pointer = V->getOperand(0);
+ PointerSize = TD.getTypeStoreSize(V->getType());
+ } else if (FreeInst *F = dyn_cast<FreeInst>(Inst)) {
+ Pointer = F->getPointerOperand();
// FreeInsts erase the entire structure
- pointerSize = ~0UL;
- } else if (CallSite::get(Inst).getInstruction() != 0) {
- if (AA.getModRefBehavior(CallSite::get(Inst)) !=
+ PointerSize = ~0UL;
+ } else if (isa<CallInst>(Inst) || isa<InvokeInst>(Inst)) {
+ if (AA.getModRefBehavior(CallSite::get(Inst)) ==
AliasAnalysis::DoesNotAccessMemory)
- return MemDepResult::get(Inst);
- continue;
+ continue;
+ return MemDepResult::get(Inst);
} else
continue;
- if (AA.getModRefInfo(C, pointer, pointerSize) != AliasAnalysis::NoModRef)
+ if (AA.getModRefInfo(C, Pointer, PointerSize) != AliasAnalysis::NoModRef)
return MemDepResult::get(Inst);
}