diff options
author | 2025-02-11 17:27:09 +0000 | |
---|---|---|
committer | 2025-02-13 03:19:37 -0800 | |
commit | e6e5f771a63f2024e00188175b69ddfe5a4a1656 (patch) | |
tree | 5d594e9c391691d57750bf616b3fab280c4eecdd | |
parent | 9a36de50228fdff9ed53e1dd9545eb446ed09943 (diff) |
Use HInstructionIteratorHandleChanges again in RTP
In http://r.android.com/2952876 we changed the RTP iterator to
HInstructionIterator, but we want the HandleChanges one.
Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing
Change-Id: I1e9e9cc84d45aa34c24a805f16798e86fd123fc3
-rw-r--r-- | compiler/optimizing/nodes.cc | 7 | ||||
-rw-r--r-- | compiler/optimizing/nodes.h | 1 | ||||
-rw-r--r-- | compiler/optimizing/reference_type_propagation.cc | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 8044a86338..6be474a8c9 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -1739,6 +1739,13 @@ void HGraphVisitor::VisitNonPhiInstructions(HBasicBlock* block) { } } +void HGraphVisitor::VisitNonPhiInstructionsHandleChanges(HBasicBlock* block) { + for (HInstructionIteratorHandleChanges it(block->GetInstructions()); !it.Done(); it.Advance()) { + DCHECK(!it.Current()->IsPhi()); + it.Current()->Accept(this); + } +} + HConstant* HTypeConversion::TryStaticEvaluation() const { return TryStaticEvaluation(GetInput()); } HConstant* HTypeConversion::TryStaticEvaluation(HInstruction* input) const { diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 86a62c1994..99fbbc6357 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -8399,6 +8399,7 @@ class HGraphVisitor : public ValueObject { protected: void VisitPhis(HBasicBlock* block); void VisitNonPhiInstructions(HBasicBlock* block); + void VisitNonPhiInstructionsHandleChanges(HBasicBlock* block); OptimizingCompilerStats* stats_; diff --git a/compiler/optimizing/reference_type_propagation.cc b/compiler/optimizing/reference_type_propagation.cc index 32b4557de0..9867e11f35 100644 --- a/compiler/optimizing/reference_type_propagation.cc +++ b/compiler/optimizing/reference_type_propagation.cc @@ -316,7 +316,7 @@ void ReferenceTypePropagation::RTPVisitor::VisitBasicBlock(HBasicBlock* block) { // Handle instructions. Since RTP may add HBoundType instructions just after the // last visited instruction, use `HInstructionIteratorHandleChanges` iterator. - VisitNonPhiInstructions(block); + VisitNonPhiInstructionsHandleChanges(block); // Add extra nodes to bound types. BoundTypeForIfNotNull(block); |