From 551754c4958086cc6910da7c950f2875e212f5cf Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Fri, 16 Apr 2010 23:37:20 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/DeadStoreElimination.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Transforms/Scalar/DeadStoreElimination.cpp') diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index d159c94..09c01d3 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(I)) return SI->getPointerOperand(); if (MemIntrinsic *MI = dyn_cast(I)) - return MI->getOperand(0); + return MI->getOperand(1); switch (cast(I)->getIntrinsicID()) { default: assert(false && "Unexpected intrinsic!"); case Intrinsic::init_trampoline: - return I->getOperand(0); - case Intrinsic::lifetime_end: return I->getOperand(1); + case Intrinsic::lifetime_end: + return I->getOperand(2); } } @@ -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(0); + Len = I->getOperand(1); 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(/*FIXME: Call*/Instruction *F, MemDepResult Dep) { +bool DSE::handleFreeWithNonTrivialDependency(Instruction *F, MemDepResult Dep) { AliasAnalysis &AA = getAnalysis(); Instruction *Dependency = Dep.getInst(); @@ -297,7 +297,7 @@ bool DSE::handleFreeWithNonTrivialDependency(/*FIXME: Call*/Instruction *F, MemD Value *DepPointer = getPointerOperand(Dependency)->getUnderlyingObject(); // Check for aliasing. - if (AA.alias(F->getOperand(0), 1, DepPointer, 1) != + if (AA.alias(F->getOperand(1), 1, DepPointer, 1) != AliasAnalysis::MustAlias) return false; -- cgit v1.1