diff options
| author | Eric Christopher <echristo@apple.com> | 2010-04-16 23:37:20 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2010-04-16 23:37:20 +0000 |
| commit | 7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2 (patch) | |
| tree | c2f3cc1957d7ba72772b73e9f98ca4d55ab5cfdf /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | |
| parent | 4ebae65d6af71115de86273e6b27f67e2cde2be7 (diff) | |
| download | llvm-7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2.zip llvm-7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2.tar.gz llvm-7258dcd77f19bf5adb5f76d4c2bb5fc426ba75c2.tar.bz2 | |
Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.
llvm-svn: 101579
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
| -rw-r--r-- | llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp index d9d085a..2aa2f17 100644 --- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -117,7 +117,7 @@ getCallSiteDependencyFrom(CallSite CS, bool isReadOnlyCall, Pointer = V->getOperand(0); PointerSize = AA->getTypeStoreSize(V->getType()); } else if (isFreeCall(Inst)) { - Pointer = Inst->getOperand(0); + Pointer = Inst->getOperand(1); // calls to free() erase the entire structure PointerSize = ~0ULL; } else if (isa<CallInst>(Inst) || isa<InvokeInst>(Inst)) { @@ -197,9 +197,9 @@ getPointerDependencyFrom(Value *MemPtr, uint64_t MemSize, bool isLoad, // pointer, not on query pointers that are indexed off of them. It'd // be nice to handle that at some point. AliasAnalysis::AliasResult R = - AA->alias(II->getOperand(2), ~0U, MemPtr, ~0U); + AA->alias(II->getOperand(3), ~0U, MemPtr, ~0U); if (R == AliasAnalysis::MustAlias) { - InvariantTag = II->getOperand(0); + InvariantTag = II->getOperand(1); continue; } @@ -210,7 +210,7 @@ getPointerDependencyFrom(Value *MemPtr, uint64_t MemSize, bool isLoad, // pointer, not on query pointers that are indexed off of them. It'd // be nice to handle that at some point. AliasAnalysis::AliasResult R = - AA->alias(II->getOperand(1), ~0U, MemPtr, ~0U); + AA->alias(II->getOperand(2), ~0U, MemPtr, ~0U); if (R == AliasAnalysis::MustAlias) return MemDepResult::getDef(II); } @@ -366,7 +366,7 @@ MemDepResult MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) { MemSize = AA->getTypeStoreSize(LI->getType()); } } else if (isFreeCall(QueryInst)) { - MemPtr = QueryInst->getOperand(0); + MemPtr = QueryInst->getOperand(1); // calls to free() erase the entire structure, not just a field. MemSize = ~0UL; } else if (isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) { @@ -378,13 +378,13 @@ MemDepResult MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) { case Intrinsic::lifetime_start: case Intrinsic::lifetime_end: case Intrinsic::invariant_start: - MemPtr = QueryInst->getOperand(1); - MemSize = cast<ConstantInt>(QueryInst->getOperand(0))->getZExtValue(); - break; - case Intrinsic::invariant_end: MemPtr = QueryInst->getOperand(2); MemSize = cast<ConstantInt>(QueryInst->getOperand(1))->getZExtValue(); break; + case Intrinsic::invariant_end: + MemPtr = QueryInst->getOperand(3); + MemSize = cast<ConstantInt>(QueryInst->getOperand(2))->getZExtValue(); + break; default: CallSite QueryCS = CallSite::get(QueryInst); bool isReadOnly = AA->onlyReadsMemory(QueryCS); |
