[llvm-commits] [llvm] r60241 - /llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Chris Lattner
sabre at nondot.org
Sat Nov 29 01:15:21 PST 2008
Author: lattner
Date: Sat Nov 29 03:15:21 2008
New Revision: 60241
URL: http://llvm.org/viewvc/llvm-project?rev=60241&view=rev
Log:
rename some variables.
Modified:
llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=60241&r1=60240&r2=60241&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Sat Nov 29 03:15:21 2008
@@ -97,35 +97,35 @@
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);
}
More information about the llvm-commits
mailing list