From 31242a99a1b58ce5267c1a74ad96a9d0b6dc1a94 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Mon, 5 Dec 2022 14:38:00 +0000 Subject: Update domination chain and RPO manually in MaybeAddExtraGotoBlocks There's no need to recompute the whole graph as we know what changed. As a drive-by, we now don't return false for graphs with irreducible loops so we can remove that restriction from the builder. However, if a graph with irreducible loops hits this path it means that: A) it's being inlined B) Has irreducible loops We don't inline graphs with irreducible loops, and after building for inline we don't remove them either because constant folding and instruction simplifier don't remove them, and DCE doesn't run for graphs with irreducible loops. So, in terms of dex2oat's outputs nothing should change. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I8cbf1b5f0518bb5dd14ffd751100ea81f5478863 --- compiler/optimizing/nodes.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 006ccfb8ec..591087bae6 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -138,7 +138,6 @@ enum GraphAnalysisResult { kAnalysisInvalidBytecode, kAnalysisFailThrowCatchLoop, kAnalysisFailAmbiguousArrayOp, - kAnalysisFailInliningIrreducibleLoop, kAnalysisFailIrreducibleLoopAndStringInit, kAnalysisFailPhiEquivalentInOsr, kAnalysisSuccess, @@ -515,6 +514,11 @@ class HGraph : public ArenaObject { HBasicBlock* SplitEdge(HBasicBlock* block, HBasicBlock* successor); void SplitCriticalEdge(HBasicBlock* block, HBasicBlock* successor); + + // Splits the edge between `block` and `successor` and then updates the graph's RPO to keep + // consistency without recomputing the whole graph. + HBasicBlock* SplitEdgeAndUpdateRPO(HBasicBlock* block, HBasicBlock* successor); + void OrderLoopHeaderPredecessors(HBasicBlock* header); // Transform a loop into a format with a single preheader. -- cgit v1.2.3-59-g8ed1b