diff options
author | 2016-10-27 15:44:54 +0000 | |
---|---|---|
committer | 2016-10-27 15:44:55 +0000 | |
commit | 384cb6674b967a9c58da9ad70fd6f98caa1d8691 (patch) | |
tree | b75a3309609ebbcd0d9d8d8b4297db82e80e988a /compiler/optimizing/instruction_simplifier.cc | |
parent | a908348b4388854dab0b655b55dbeac1ecec2949 (diff) | |
parent | 2c45bc9137c29f886e69923535aff31a74d90829 (diff) |
Merge "Remove H[Reverse]PostOrderIterator and HInsertionOrderIterator."
Diffstat (limited to 'compiler/optimizing/instruction_simplifier.cc')
-rw-r--r-- | compiler/optimizing/instruction_simplifier.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc index 3bb1c1dc21..e4d280f26d 100644 --- a/compiler/optimizing/instruction_simplifier.cc +++ b/compiler/optimizing/instruction_simplifier.cc @@ -124,20 +124,16 @@ void InstructionSimplifier::Run() { void InstructionSimplifierVisitor::Run() { // Iterate in reverse post order to open up more simplifications to users // of instructions that got simplified. - for (HReversePostOrderIterator it(*GetGraph()); !it.Done();) { + for (HBasicBlock* block : GetGraph()->GetReversePostOrder()) { // The simplification of an instruction to another instruction may yield // possibilities for other simplifications. So although we perform a reverse // post order visit, we sometimes need to revisit an instruction index. - simplification_occurred_ = false; - VisitBasicBlock(it.Current()); - if (simplification_occurred_ && - (simplifications_at_current_position_ < kMaxSamePositionSimplifications)) { - // New simplifications may be applicable to the instruction at the - // current index, so don't advance the iterator. - continue; - } + do { + simplification_occurred_ = false; + VisitBasicBlock(block); + } while (simplification_occurred_ && + (simplifications_at_current_position_ < kMaxSamePositionSimplifications)); simplifications_at_current_position_ = 0; - it.Advance(); } } |