diff options
author | 2024-02-09 11:30:36 +0000 | |
---|---|---|
committer | 2024-02-13 17:57:29 +0000 | |
commit | 0d5dbf73461556afcd6e1a7e1109199d0fc16887 (patch) | |
tree | d5904ca2d1cb0682efe283f3219495c2a10361ed /compiler/optimizing/optimizing_compiler.cc | |
parent | 008db94e90e07bc4d262c80ef2975681299b32fa (diff) |
Reland "Only compile optimized if it is useful."
This reverts commit 35a1479ab434257e9db629fda5f4ca96bfbef3fc.
Reason for revert: Disable failing test on debuggable
Change-Id: Icd012ac9e3b37c1187adf5e915ba7c1ffc415805
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index a1c4130bc1..65e8e51712 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -905,6 +905,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator, } if (compilation_kind == CompilationKind::kBaseline && compiler_options.ProfileBranches()) { + graph->SetUsefulOptimizing(); // Branch profiling currently doesn't support running optimizations. RunRequiredPasses(graph, codegen.get(), dex_compilation_unit, &pass_observer); } else { @@ -917,6 +918,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator, // this method already, do it now. if (jit != nullptr && compilation_kind == CompilationKind::kBaseline && + graph->IsUsefulOptimizing() && graph->GetProfilingInfo() == nullptr) { ProfilingInfoBuilder( graph, codegen->GetCompilerOptions(), codegen.get(), compilation_stats_.get()).Run(); @@ -1448,6 +1450,11 @@ bool OptimizingCompiler::JitCompile(Thread* self, debug_info = GenerateJitDebugInfo(info); } + if (compilation_kind == CompilationKind::kBaseline && + !codegen->GetGraph()->IsUsefulOptimizing()) { + compilation_kind = CompilationKind::kOptimized; + } + if (!code_cache->Commit(self, region, method, |