From 6ef45677305048c2bf0600f1c4b98a11b2cfaffb Mon Sep 17 00:00:00 2001 From: Igor Murashkin Date: Tue, 8 Aug 2017 13:59:55 -0700 Subject: optimizing: Add statistics for # of constructor fences added/removed Statistics are attributed as follows: Added because: * HNewInstances requires a HConstructorFence following it. * HReturn requires a HConstructorFence (for final fields) preceding it. Removed because: * Optimized in Load-Store-Elimination. * Optimized in Prepare-For-Register-Allocation. Test: art/test.py Bug: 36656456 Change-Id: Ic119441c5151a5a840fc6532b411340e2d68e5eb --- compiler/optimizing/optimizing_compiler.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 70bbc382b4..435ca1cad4 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -711,11 +711,12 @@ NO_INLINE // Avoid increasing caller's frame size by large stack-allocated obje static void AllocateRegisters(HGraph* graph, CodeGenerator* codegen, PassObserver* pass_observer, - RegisterAllocator::Strategy strategy) { + RegisterAllocator::Strategy strategy, + OptimizingCompilerStats* stats) { { PassScope scope(PrepareForRegisterAllocation::kPrepareForRegisterAllocationPassName, pass_observer); - PrepareForRegisterAllocation(graph).Run(); + PrepareForRegisterAllocation(graph, stats).Run(); } SsaLivenessAnalysis liveness(graph, codegen); { @@ -1035,7 +1036,8 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* arena, AllocateRegisters(graph, codegen.get(), &pass_observer, - regalloc_strategy); + regalloc_strategy, + compilation_stats_.get()); codegen->Compile(code_allocator); pass_observer.DumpDisassembly(); -- cgit v1.2.3-59-g8ed1b