aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-04-16 15:33:14 +0000
committerGabor Greif <ggreif@gmail.com>2010-04-16 15:33:14 +0000
commit4ec2258ffb495d7ce00177e447740ef1123a27db (patch)
tree491894533b2bbca44875d321e209e1dc2e27abb3 /lib/Analysis/MemoryDependenceAnalysis.cpp
parent52d55bd224ac08dfef959527ca8257f82a80dbb0 (diff)
downloadexternal_llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.zip
external_llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.tar.gz
external_llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.tar.bz2
reapply r101434
with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 2aa2f17..d9d085a 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/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(1);
+ Pointer = Inst->getOperand(0);
// 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(3), ~0U, MemPtr, ~0U);
+ AA->alias(II->getOperand(2), ~0U, MemPtr, ~0U);
if (R == AliasAnalysis::MustAlias) {
- InvariantTag = II->getOperand(1);
+ InvariantTag = II->getOperand(0);
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(2), ~0U, MemPtr, ~0U);
+ AA->alias(II->getOperand(1), ~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(1);
+ MemPtr = QueryInst->getOperand(0);
// calls to free() erase the entire structure, not just a field.
MemSize = ~0UL;
} else if (isa<CallInst>(QueryInst) || isa<InvokeInst>(QueryInst)) {
@@ -378,12 +378,12 @@ MemDepResult MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) {
case Intrinsic::lifetime_start:
case Intrinsic::lifetime_end:
case Intrinsic::invariant_start:
- MemPtr = QueryInst->getOperand(2);
- MemSize = cast<ConstantInt>(QueryInst->getOperand(1))->getZExtValue();
+ MemPtr = QueryInst->getOperand(1);
+ MemSize = cast<ConstantInt>(QueryInst->getOperand(0))->getZExtValue();
break;
case Intrinsic::invariant_end:
- MemPtr = QueryInst->getOperand(3);
- MemSize = cast<ConstantInt>(QueryInst->getOperand(2))->getZExtValue();
+ MemPtr = QueryInst->getOperand(2);
+ MemSize = cast<ConstantInt>(QueryInst->getOperand(1))->getZExtValue();
break;
default:
CallSite QueryCS = CallSite::get(QueryInst);