diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-04-16 15:33:14 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-04-16 15:33:14 +0000 |
commit | 4ec2258ffb495d7ce00177e447740ef1123a27db (patch) | |
tree | 491894533b2bbca44875d321e209e1dc2e27abb3 /lib/Transforms/Scalar/DeadStoreElimination.cpp | |
parent | 52d55bd224ac08dfef959527ca8257f82a80dbb0 (diff) | |
download | llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.tar.gz llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.tar.bz2 llvm-4ec2258ffb495d7ce00177e447740ef1123a27db.tar.xz |
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/Transforms/Scalar/DeadStoreElimination.cpp')
-rw-r--r-- | lib/Transforms/Scalar/DeadStoreElimination.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index 09c01d3141..d159c9473e 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -123,14 +123,14 @@ static Value *getPointerOperand(Instruction *I) { if (StoreInst *SI = dyn_cast<StoreInst>(I)) return SI->getPointerOperand(); if (MemIntrinsic *MI = dyn_cast<MemIntrinsic>(I)) - return MI->getOperand(1); + return MI->getOperand(0); switch (cast<IntrinsicInst>(I)->getIntrinsicID()) { default: assert(false && "Unexpected intrinsic!"); case Intrinsic::init_trampoline: - return I->getOperand(1); + return I->getOperand(0); case Intrinsic::lifetime_end: - return I->getOperand(2); + return I->getOperand(1); } } @@ -152,7 +152,7 @@ static unsigned getStoreSize(Instruction *I, const TargetData *TD) { case Intrinsic::init_trampoline: return -1u; case Intrinsic::lifetime_end: - Len = I->getOperand(1); + Len = I->getOperand(0); break; } } @@ -287,7 +287,7 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { /// handleFreeWithNonTrivialDependency - Handle frees of entire structures whose /// dependency is a store to a field of that structure. -bool DSE::handleFreeWithNonTrivialDependency(Instruction *F, MemDepResult Dep) { +bool DSE::handleFreeWithNonTrivialDependency(/*FIXME: Call*/Instruction *F, MemDepResult Dep) { AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); Instruction *Dependency = Dep.getInst(); @@ -297,7 +297,7 @@ bool DSE::handleFreeWithNonTrivialDependency(Instruction *F, MemDepResult Dep) { Value *DepPointer = getPointerOperand(Dependency)->getUnderlyingObject(); // Check for aliasing. - if (AA.alias(F->getOperand(1), 1, DepPointer, 1) != + if (AA.alias(F->getOperand(0), 1, DepPointer, 1) != AliasAnalysis::MustAlias) return false; |