summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index f84735d0a12..320afa19d5f 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -523,9 +523,8 @@ void DSE::DeleteDeadInstruction(Instruction *I,
// Before we touch this instruction, remove it from memdep!
MemoryDependenceAnalysis &MDA = getAnalysis<MemoryDependenceAnalysis>();
- while (!NowDeadInsts.empty()) {
- Instruction *DeadInst = NowDeadInsts.back();
- NowDeadInsts.pop_back();
+ do {
+ Instruction *DeadInst = NowDeadInsts.pop_back_val();
++NumFastOther;
@@ -549,7 +548,7 @@ void DSE::DeleteDeadInstruction(Instruction *I,
DeadInst->eraseFromParent();
if (ValueSet) ValueSet->erase(DeadInst);
- }
+ } while (!NowDeadInsts.empty());
}
unsigned DSE::getPointerSize(Value *V) const {
OpenPOWER on IntegriCloud