diff options
author | Calin Juravle <calin@google.com> | 2015-07-29 15:58:48 +0100 |
---|---|---|
committer | Roland Levillain <rpl@google.com> | 2015-07-30 09:40:39 +0000 |
commit | 8f96df846403703e14016590b4c0c3af870561d9 (patch) | |
tree | a0aeed0c8f408318ed17ab0519dcbb3451467303 /dex2oat | |
parent | 681652d8e8a33bc07c5c082a71aea13d0f15e0a0 (diff) | |
download | art-8f96df846403703e14016590b4c0c3af870561d9.zip art-8f96df846403703e14016590b4c0c3af870561d9.tar.gz art-8f96df846403703e14016590b4c0c3af870561d9.tar.bz2 |
Allow for fine tuning the inliner.
Bug: 21868508
(cherry picked and squashed from commits
ec74835a7e4f2660250a2f3f9508cbbe5269e49a and
0941b9d48a9a8c6d80a1af7a0d0fc9f80fe2b9a1)
Change-Id: I1750e6bea20321d04680132281a6c2924531c5ae
Diffstat (limited to 'dex2oat')
-rw-r--r-- | dex2oat/dex2oat.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index d21f5cb..d1fe039 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -280,6 +280,18 @@ NO_RETURN static void Usage(const char* fmt, ...) { UsageError(" Example: --num-dex-method=%d", CompilerOptions::kDefaultNumDexMethodsThreshold); UsageError(" Default: %d", CompilerOptions::kDefaultNumDexMethodsThreshold); UsageError(""); + UsageError(" --inline-depth-limit=<depth-limit>: the depth limit of inlining for fine tuning"); + UsageError(" the compiler. A zero value will disable inlining. Honored only by Optimizing."); + UsageError(" Example: --inline-depth-limit=%d", CompilerOptions::kDefaultInlineDepthLimit); + UsageError(" Default: %d", CompilerOptions::kDefaultInlineDepthLimit); + UsageError(""); + UsageError(" --inline-max-code-units=<code-units-count>: the maximum code units that a method"); + UsageError(" can have to be considered for inlining. A zero value will disable inlining."); + UsageError(" Honored only by Optimizing."); + UsageError(" Example: --inline-max-code-units=%d", + CompilerOptions::kDefaultInlineMaxCodeUnits); + UsageError(" Default: %d", CompilerOptions::kDefaultInlineMaxCodeUnits); + UsageError(""); UsageError(" --dump-timing: display a breakdown of where time was spent"); UsageError(""); UsageError(" --include-patch-information: Include patching information so the generated code"); @@ -550,6 +562,8 @@ class Dex2Oat FINAL { int small_method_threshold = CompilerOptions::kDefaultSmallMethodThreshold; int tiny_method_threshold = CompilerOptions::kDefaultTinyMethodThreshold; int num_dex_methods_threshold = CompilerOptions::kDefaultNumDexMethodsThreshold; + int inline_depth_limit = CompilerOptions::kDefaultInlineDepthLimit; + int inline_max_code_units = CompilerOptions::kDefaultInlineMaxCodeUnits; // Profile file to use double top_k_profile_threshold = CompilerOptions::kDefaultTopKProfileThreshold; @@ -720,6 +734,22 @@ class Dex2Oat FINAL { if (num_dex_methods_threshold < 0) { Usage("--num-dex-methods passed a negative value %s", num_dex_methods_threshold); } + } else if (option.starts_with("--inline-depth-limit=")) { + const char* limit = option.substr(strlen("--inline-depth-limit=")).data(); + if (!ParseInt(limit, &inline_depth_limit)) { + Usage("Failed to parse --inline-depth-limit '%s' as an integer", limit); + } + if (inline_depth_limit < 0) { + Usage("--inline-depth-limit passed a negative value %s", inline_depth_limit); + } + } else if (option.starts_with("--inline-max-code-units=")) { + const char* code_units = option.substr(strlen("--inline-max-code-units=")).data(); + if (!ParseInt(code_units, &inline_max_code_units)) { + Usage("Failed to parse --inline-max-code-units '%s' as an integer", code_units); + } + if (inline_max_code_units < 0) { + Usage("--inline-max-code-units passed a negative value %s", inline_max_code_units); + } } else if (option == "--host") { is_host_ = true; } else if (option == "--runtime-arg") { @@ -992,6 +1022,8 @@ class Dex2Oat FINAL { small_method_threshold, tiny_method_threshold, num_dex_methods_threshold, + inline_depth_limit, + inline_max_code_units, include_patch_information, top_k_profile_threshold, debuggable, |