From d2d10628dc0f947219c6b63972a53d45e334f8d6 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Wed, 7 Dec 2022 19:22:43 +0000 Subject: Update loop information correctly in MaybeAddExtraGotoBlocks There are cases in which we have a Return->TryBoundary kind:exit->Exit chain inside of a loop, and that said TryBoundary has loop information. Set that information in the new goto block. Bug: 261731237 Fixes: 261731237 Test: dex2oat compiling the apps in the bug Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I224d6cb449d1a7a1a987f4e9022098f84ae4fba2 --- compiler/optimizing/builder.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/builder.cc') diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 897d8b7015..c9609e0bda 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -124,12 +124,9 @@ void HGraphBuilder::MaybeAddExtraGotoBlocks() { if (NeedsExtraGotoBlock(predecessor)) { HBasicBlock* new_goto = graph_->SplitEdgeAndUpdateRPO(predecessor, exit); new_goto->AddInstruction(new (graph_->GetAllocator()) HGoto(predecessor->GetDexPc())); - - // No need to update loop info of the new block. - DCHECK(!predecessor->IsInLoop()) - << " we should only add the extra Goto blocks for Return/ReturnVoid->TryBoundary->Exit " - << "chains. In those chains, the TryBoundary of kind:exit should never be a part of a " - << "loop"; + if (predecessor->IsInLoop()) { + new_goto->SetLoopInformation(predecessor->GetLoopInformation()); + } // Update domination chain if (!predecessor->GetDominatedBlocks().empty()) { -- cgit v1.2.3-59-g8ed1b