From 0eca098c263e3f93d9996dbd6070a53d09d4a6c6 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 8 Apr 2022 18:00:48 +0100 Subject: Enable LoopOptimization for graphs with try catch blocks We can enable the optimization when the graph has try catch blocks, but we do not perform the optimizations if the loops themselves have try catch blocks. Bug: 227283906 Change-Id: I8889d2ed7a5a260d5c2dcbbc5184cb7eaf3a8f9f --- compiler/optimizing/superblock_cloner.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/superblock_cloner.cc') diff --git a/compiler/optimizing/superblock_cloner.cc b/compiler/optimizing/superblock_cloner.cc index b46d193541..a5f919c31c 100644 --- a/compiler/optimizing/superblock_cloner.cc +++ b/compiler/optimizing/superblock_cloner.cc @@ -855,11 +855,20 @@ void SuperblockCloner::SetSuccessorRemappingInfo(const HEdgeSet* remap_orig_inte } bool SuperblockCloner::IsSubgraphClonable() const { - // TODO: Support irreducible graphs and graphs with try-catch. - if (graph_->HasIrreducibleLoops() || graph_->HasTryCatch()) { + // TODO: Support irreducible graphs and subgraphs with try-catch. + if (graph_->HasIrreducibleLoops()) { return false; } + for (HBasicBlock* block : graph_->GetReversePostOrder()) { + if (!IsInOrigBBSet(block)) { + continue; + } + if (block->GetTryCatchInformation() != nullptr) { + return false; + } + } + HInstructionMap live_outs( std::less(), graph_->GetAllocator()->Adapter(kArenaAllocSuperblockCloner)); -- cgit v1.2.3-59-g8ed1b