summaryrefslogtreecommitdiff
path: root/compiler/optimizing/ssa_phi_elimination.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-09-25 13:59:08 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-09-25 13:59:08 +0000
commitec7e44f7afe0ff48d4d1ae54a12d375e0392d24c (patch)
tree30ce5725c7258d6584a56f2c6382cee529df2cc2 /compiler/optimizing/ssa_phi_elimination.cc
parente92ed9d31bae7ccd48b60aa921e9dd2ca96ac9db (diff)
parent2aaa4b5532d30c4e65d8892b556400bb61f9dc8c (diff)
Merge "Optimizing: Tag more arena allocations."
Diffstat (limited to 'compiler/optimizing/ssa_phi_elimination.cc')
-rw-r--r--compiler/optimizing/ssa_phi_elimination.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/optimizing/ssa_phi_elimination.cc b/compiler/optimizing/ssa_phi_elimination.cc
index a9f04cd201..72f9ddd506 100644
--- a/compiler/optimizing/ssa_phi_elimination.cc
+++ b/compiler/optimizing/ssa_phi_elimination.cc
@@ -35,7 +35,7 @@ void SsaDeadPhiElimination::MarkDeadPhis() {
HUseListNode<HInstruction*>* current = use_it.Current();
HInstruction* user = current->GetUser();
if (!user->IsPhi()) {
- worklist_.Add(phi);
+ worklist_.push_back(phi);
phi->SetLive();
break;
}
@@ -44,12 +44,13 @@ void SsaDeadPhiElimination::MarkDeadPhis() {
}
// Process the worklist by propagating liveness to phi inputs.
- while (!worklist_.IsEmpty()) {
- HPhi* phi = worklist_.Pop();
+ while (!worklist_.empty()) {
+ HPhi* phi = worklist_.back();
+ worklist_.pop_back();
for (HInputIterator it(phi); !it.Done(); it.Advance()) {
HInstruction* input = it.Current();
if (input->IsPhi() && input->AsPhi()->IsDead()) {
- worklist_.Add(input->AsPhi());
+ worklist_.push_back(input->AsPhi());
input->AsPhi()->SetLive();
}
}
@@ -103,12 +104,13 @@ void SsaRedundantPhiElimination::Run() {
for (HReversePostOrderIterator it(*graph_); !it.Done(); it.Advance()) {
HBasicBlock* block = it.Current();
for (HInstructionIterator inst_it(block->GetPhis()); !inst_it.Done(); inst_it.Advance()) {
- worklist_.Add(inst_it.Current()->AsPhi());
+ worklist_.push_back(inst_it.Current()->AsPhi());
}
}
- while (!worklist_.IsEmpty()) {
- HPhi* phi = worklist_.Pop();
+ while (!worklist_.empty()) {
+ HPhi* phi = worklist_.back();
+ worklist_.pop_back();
// If the phi has already been processed, continue.
if (!phi->IsInBlock()) {
@@ -155,7 +157,7 @@ void SsaRedundantPhiElimination::Run() {
HUseListNode<HInstruction*>* current = it.Current();
HInstruction* user = current->GetUser();
if (user->IsPhi()) {
- worklist_.Add(user->AsPhi());
+ worklist_.push_back(user->AsPhi());
}
}