From ced2fc97ec95f2924059544f13d6ff353973d552 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 8 Feb 2024 09:49:48 +0000 Subject: 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 --- compiler/optimizing/constant_folding.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/constant_folding.cc') diff --git a/compiler/optimizing/constant_folding.cc b/compiler/optimizing/constant_folding.cc index b0a65ca64d..f57d8ade16 100644 --- a/compiler/optimizing/constant_folding.cc +++ b/compiler/optimizing/constant_folding.cc @@ -117,12 +117,9 @@ bool HConstantFolding::Run() { void HConstantFoldingVisitor::VisitBasicBlock(HBasicBlock* block) { - // Traverse this block's instructions (phis don't need to be - // processed) in (forward) order and replace the ones that can be - // statically evaluated by a compile-time counterpart. - for (HInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) { - it.Current()->Accept(this); - } + // Traverse this block's instructions (phis don't need to be processed) in (forward) order + // and replace the ones that can be statically evaluated by a compile-time counterpart. + VisitNonPhiInstructions(block); } void HConstantFoldingVisitor::VisitUnaryOperation(HUnaryOperation* inst) { -- cgit v1.2.3-59-g8ed1b