diff options
author | 2024-02-08 09:49:48 +0000 | |
---|---|---|
committer | 2024-02-09 09:05:18 +0000 | |
commit | ced2fc97ec95f2924059544f13d6ff353973d552 (patch) | |
tree | 7131429c7cd6b9a18ef255ce5d7a160ac274c371 /compiler/optimizing/nodes.cc | |
parent | cea2f596f98b79fafaded1c36c98aa3fa04d5147 (diff) |
Clean up `HGraphVisitor::VisitBasicBlock()`.
Skip `HPhi::Accept()` and add functions to visit only Phis
or only non-Phi instructions.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Bug: 181943478
Change-Id: Iba0690ae70f46d6a2bafa9055b2ae5167e58a2f4
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r-- | compiler/optimizing/nodes.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc index 94f197d8f1..c87c78815b 100644 --- a/compiler/optimizing/nodes.cc +++ b/compiler/optimizing/nodes.cc @@ -1693,10 +1693,20 @@ void HGraphVisitor::VisitReversePostOrder() { } void HGraphVisitor::VisitBasicBlock(HBasicBlock* block) { + VisitPhis(block); + VisitNonPhiInstructions(block); +} + +void HGraphVisitor::VisitPhis(HBasicBlock* block) { for (HInstructionIterator it(block->GetPhis()); !it.Done(); it.Advance()) { - it.Current()->Accept(this); + DCHECK(it.Current()->IsPhi()); + VisitPhi(it.Current()->AsPhi()); } +} + +void HGraphVisitor::VisitNonPhiInstructions(HBasicBlock* block) { for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) { + DCHECK(!it.Current()->IsPhi()); it.Current()->Accept(this); } } |