From cbf82dafb9bfe0543a64a4a471765069516e9456 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Tue, 29 Oct 2024 11:00:42 +0000 Subject: Run RTP after GVN to remove more NullCheck instructions After GVN, we deduplicate instructions and we might have more information regarding the nullability of the SSA variable. We can run RTP to insert the BoundType instructions, which will later be used by InstructionSimplifier to remove the NullCheck. RTP will be run conditionally, only if GVN did at least one replacement. It improves ~0.1% of odex size for speed compiled apps. Bug: 369206455 Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing Change-Id: I0a4a104690b3fe9ac4118642ab9e9916dc30a9c5 --- compiler/optimizing/optimizing_compiler.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 89edbed54d..b15657355f 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -665,6 +665,9 @@ void OptimizingCompiler::RunOptimizations(HGraph* graph, OptDef(OptimizationPass::kSideEffectsAnalysis, "side_effects$before_gvn"), OptDef(OptimizationPass::kGlobalValueNumbering), + OptDef(OptimizationPass::kReferenceTypePropagation, + "reference_type_propagation$after_gvn", + OptimizationPass::kGlobalValueNumbering), // Simplification (TODO: only if GVN occurred). OptDef(OptimizationPass::kSelectGenerator), OptDef(OptimizationPass::kConstantFolding, -- cgit v1.2.3-59-g8ed1b