From: Chris Lattner Date: Fri, 28 Nov 2008 22:50:08 +0000 (+0000) Subject: don't revisit instructions off the beginning of the block. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=5425f22fa3f8cbbcbc1a76fc7df2fa251cdc132d;p=oota-llvm.git don't revisit instructions off the beginning of the block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60221 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/DeadStoreElimination.cpp b/lib/Transforms/Scalar/DeadStoreElimination.cpp index b48bbeae66b..e6a05b7e90b 100644 --- a/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -132,7 +132,8 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { // If we deleted a store, reinvestigate this instruction. if (deletedStore) { - --BBI; + if (!isa(BB.begin())) + --BBI; continue; } } @@ -160,7 +161,8 @@ bool DSE::runOnBasicBlock(BasicBlock &BB) { DT.dominates(dep, L))) { DeleteDeadInstruction(S); - --BBI; + if (!isa(BB.begin())) + --BBI; NumFastStores++; MadeChange = true; } else