From 74da668328e1c501742a864d23ba8c114ece5e64 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 16 Dec 2022 19:28:47 +0000 Subject: Update the graph flags and check consistency Check that the flags are up to date in graph checker. Mainly a correctness check CL but it brings slight code size reduction (e.g. not needing vreg info if HasMonitorOperations is false). Update loop_optimization_test to stop using `LocalRun` directly as it meant that it was breaking assumptions (i.e. top_loop_ was nullptr when it was expected to have a value). Bug: 264278131 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I29765b3be46d4bd7c91ea9c80f7565a3c88fae2e --- compiler/optimizing/loop_optimization.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'compiler/optimizing/loop_optimization.cc') diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc index 001649cb9f..7a52502562 100644 --- a/compiler/optimizing/loop_optimization.cc +++ b/compiler/optimizing/loop_optimization.cc @@ -507,9 +507,8 @@ bool HLoopOptimization::Run() { graph_->SetHasLoops(false); // no more loops } - // Detach. + // Detach allocator. loop_allocator_ = nullptr; - last_loop_ = top_loop_ = nullptr; return did_loop_opt; } @@ -530,11 +529,7 @@ bool HLoopOptimization::LocalRun() { AddLoop(block->GetLoopInformation()); } } - - // TODO(solanes): How can `top_loop_` be null if `graph_->HasLoops()` is true? - if (top_loop_ == nullptr) { - return false; - } + DCHECK(top_loop_ != nullptr); // Traverse the loop hierarchy inner-to-outer and optimize. Traversal can use // temporary data structures using the phase-local allocator. All new HIR -- cgit v1.2.3-59-g8ed1b