diff options
author | 2015-11-10 10:12:41 +0000 | |
---|---|---|
committer | 2015-11-10 11:22:42 +0000 | |
commit | 81e479e5f768fd8ff46c2a894640a094d12800e2 (patch) | |
tree | 1c0a319e756eaf59b24c0014ebfd707eea385cad /compiler/optimizing/graph_checker.cc | |
parent | 1963759e84664b51b617b00e15728f439895033b (diff) |
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
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 9 |
1 files changed, 7 insertions, 2 deletions
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())); |