From b2d364d0eee1d6df4b49e3a7d5b3c4c11af3b3ca Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Thu, 10 Nov 2022 10:26:31 +0000 Subject: Remove tries which don't contain throwing instructions If nothing can throw within a TryBoundary, we are safe to eliminate it. We were already doing this at the builder stage, but this CL takes care of subsequent passes (e.g. we might remove DivZeroCheck instructions which means that now we know we can't throw). Sometimes this means we are able to eliminate catch blocks which brings some code size improvements. Locally on a Pixel 5 compiling with `speed`: * AGSA -684K (0.2%) * services.jar -100K (0.2%) * SystemUIGoogle -88K (0.3%) Bug: 229249867 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I36d5880be99c1f1109c94266b1be583de8d6cf72 --- compiler/optimizing/optimizing_compiler_stats.h | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/optimizing/optimizing_compiler_stats.h') diff --git a/compiler/optimizing/optimizing_compiler_stats.h b/compiler/optimizing/optimizing_compiler_stats.h index 192519bdd4..02f1fe9d0d 100644 --- a/compiler/optimizing/optimizing_compiler_stats.h +++ b/compiler/optimizing/optimizing_compiler_stats.h @@ -47,6 +47,7 @@ enum class MethodCompilationStat { kUnresolvedFieldNotAFastAccess, kRemovedCheckedCast, kRemovedDeadInstruction, + kRemovedTry, kRemovedNullCheck, kNotCompiledSkipped, kNotCompiledInvalidBytecode, -- cgit v1.2.3-59-g8ed1b