diff options
| author | 2015-12-17 15:26:21 +0000 | |
|---|---|---|
| committer | 2015-12-17 15:26:21 +0000 | |
| commit | b17d1ccff0ac26fc22df671907ba2b4f4c656ce4 (patch) | |
| tree | cf202a0e783e523c9a0e4d8b25f0dc7a1d4df118 /compiler/optimizing/inliner.cc | |
| parent | fcb7613d3aaa9a6802800b6e957aaad51cedf6dc (diff) | |
Revert "Tweak inlining heuristics."
This reverts commit fcb7613d3aaa9a6802800b6e957aaad51cedf6dc.
Change-Id: Idc0df6a2f68e8b5aa740bb1259f19c2953811510
Diffstat (limited to 'compiler/optimizing/inliner.cc')
| -rw-r--r-- | compiler/optimizing/inliner.cc | 26 | 
1 files changed, 2 insertions, 24 deletions
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 6d5f6eb55e..db1170909f 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -42,14 +42,7 @@  namespace art { -static constexpr size_t kMaximumNumberOfHInstructions = 32; - -// Limit the number of dex registers that we accumulate while inlining -// to avoid creating large amount of nested environments. -static constexpr size_t kMaximumNumberOfCumulatedDexRegisters = 64; - -// Avoid inlining within a huge method due to memory pressure. -static constexpr size_t kMaximumCodeUnitSize = 4096; +static constexpr size_t kMaximumNumberOfHInstructions = 12;  void HInliner::Run() {    const CompilerOptions& compiler_options = compiler_driver_->GetCompilerOptions(); @@ -57,9 +50,6 @@ void HInliner::Run() {        || (compiler_options.GetInlineMaxCodeUnits() == 0)) {      return;    } -  if (caller_compilation_unit_.GetCodeItem()->insns_size_in_code_units_ > kMaximumCodeUnitSize) { -    return; -  }    if (graph_->IsDebuggable()) {      // For simplicity, we currently never inline when the graph is debuggable. This avoids      // doing some logic in the runtime to discover if a method could have been inlined. @@ -587,7 +577,6 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,                       compiler_driver_,                       handles_,                       stats_, -                     total_number_of_dex_registers_ + code_item->registers_size_,                       depth_ + 1);      inliner.Run();      number_of_instructions_budget += inliner.number_of_inlined_instructions_; @@ -619,10 +608,6 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,    HReversePostOrderIterator it(*callee_graph);    it.Advance();  // Past the entry block, it does not contain instructions that prevent inlining.    size_t number_of_instructions = 0; - -  bool can_inline_environment = -      total_number_of_dex_registers_ < kMaximumNumberOfCumulatedDexRegisters; -    for (; !it.Done(); it.Advance()) {      HBasicBlock* block = it.Current();      if (block->IsLoopHeader()) { @@ -636,17 +621,10 @@ bool HInliner::TryBuildAndInline(ArtMethod* resolved_method,           instr_it.Advance()) {        if (number_of_instructions++ ==  number_of_instructions_budget) {          VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) -                       << " is not inlined because its caller has reached" -                       << " its instruction budget limit."; +                       << " could not be inlined because it is too big.";          return false;        }        HInstruction* current = instr_it.Current(); -      if (!can_inline_environment && current->NeedsEnvironment()) { -        VLOG(compiler) << "Method " << PrettyMethod(method_index, callee_dex_file) -                       << " is not inlined because its caller has reached" -                       << " its environment budget limit."; -        return false; -      }        if (current->IsInvokeInterface()) {          // Disable inlining of interface calls. The cost in case of entering the  |