From 81e479e5f768fd8ff46c2a894640a094d12800e2 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Tue, 10 Nov 2015 10:12:41 +0000 Subject: ART: Fix critical edge checks in GraphChecker Previous CL I5a13b8bb74509b48f5d628906f7158af007f99ae fixed logic for splitting critical edges. The same logic is used in GraphChecker when testing critical edges weren't introduced by a pass. This patch updates it too. Bug: 25493695 Bug: 25454012 Change-Id: I56226c82324ee55ae2fbe7262608dd2868d930f1 --- compiler/optimizing/graph_checker.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'compiler/optimizing/graph_checker.cc') diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 0d7c796837..27949f7fe8 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -393,10 +393,15 @@ void SSAChecker::VisitBasicBlock(HBasicBlock* block) { // block with multiple successors to a block with multiple // predecessors). Exceptional edges are synthesized and hence // not accounted for. - if (block->NumberOfNormalSuccessors() > 1) { + if (block->GetSuccessors().size() > 1) { for (size_t j = 0, e = block->NumberOfNormalSuccessors(); j < e; ++j) { HBasicBlock* successor = block->GetSuccessors()[j]; - if (successor->GetPredecessors().size() > 1) { + if (successor->IsExitBlock() && + block->IsSingleTryBoundary() && + block->GetPredecessors().size() == 1u && + block->GetSinglePredecessor()->GetLastInstruction()->IsThrow()) { + // Allowed critical edge Throw->TryBoundary->Exit. + } else if (successor->GetPredecessors().size() > 1) { AddError(StringPrintf("Critical edge between blocks %d and %d.", block->GetBlockId(), successor->GetBlockId())); -- cgit v1.2.3-59-g8ed1b