summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Levillain <rpl@google.com>2015-08-07 16:13:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-07 16:13:34 +0000
commit95c6649a4502fffcf9a838a39a7a95fe27082c65 (patch)
tree2931ee20acf1786eeb36bb994b08863de984395b
parenta1620b7f44ab2ebc800ce29e6378a3aa7776022e (diff)
parentd333389cf635e002658a77e64547631e05004447 (diff)
downloadart-95c6649a4502fffcf9a838a39a7a95fe27082c65.tar.gz
art-95c6649a4502fffcf9a838a39a7a95fe27082c65.tar.bz2
art-95c6649a4502fffcf9a838a39a7a95fe27082c65.zip
am d333389c: Tighten default inlining settings when using the space filter.
* commit 'd333389cf635e002658a77e64547631e05004447': Tighten default inlining settings when using the space filter.
-rw-r--r--compiler/driver/compiler_options.h4
-rw-r--r--dex2oat/dex2oat.cc27
2 files changed, 28 insertions, 3 deletions
diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h
index a34116d340..03cdd6186c 100644
--- a/compiler/driver/compiler_options.h
+++ b/compiler/driver/compiler_options.h
@@ -54,6 +54,10 @@ class CompilerOptions FINAL {
static const size_t kDefaultInlineDepthLimit = 5;
static const size_t kDefaultInlineMaxCodeUnits = 100;
+ // Default inlining settings when the space filter is used.
+ static constexpr size_t kSpaceFilterInlineDepthLimit = 5;
+ static constexpr size_t kSpaceFilterInlineMaxCodeUnits = 10;
+
CompilerOptions();
~CompilerOptions();
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index d1fe039737..e913c20407 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -282,12 +282,15 @@ NO_RETURN static void Usage(const char* fmt, ...) {
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(" Has priority over the --compiler-filter option. Intended for ");
+ UsageError(" development/experimental use.");
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(" Honored only by Optimizing. Has priority over the --compiler-filter option.");
+ UsageError(" Intended for development/experimental use.");
UsageError(" Example: --inline-max-code-units=%d",
CompilerOptions::kDefaultInlineMaxCodeUnits);
UsageError(" Default: %d", CompilerOptions::kDefaultInlineMaxCodeUnits);
@@ -562,8 +565,10 @@ 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;
+ static constexpr int kUnsetInlineDepthLimit = -1;
+ int inline_depth_limit = kUnsetInlineDepthLimit;
+ static constexpr int kUnsetInlineMaxCodeUnits = -1;
+ int inline_max_code_units = kUnsetInlineMaxCodeUnits;
// Profile file to use
double top_k_profile_threshold = CompilerOptions::kDefaultTopKProfileThreshold;
@@ -994,6 +999,22 @@ class Dex2Oat FINAL {
Usage("Unknown --compiler-filter value %s", compiler_filter_string);
}
+ // It they are not set, use default values for inlining settings.
+ // TODO: We should rethink the compiler filter. We mostly save
+ // time here, which is orthogonal to space.
+ if (inline_depth_limit == kUnsetInlineDepthLimit) {
+ inline_depth_limit = (compiler_filter == CompilerOptions::kSpace)
+ // Implementation of the space filter: limit inlining depth.
+ ? CompilerOptions::kSpaceFilterInlineDepthLimit
+ : CompilerOptions::kDefaultInlineDepthLimit;
+ }
+ if (inline_max_code_units == kUnsetInlineMaxCodeUnits) {
+ inline_max_code_units = (compiler_filter == CompilerOptions::kSpace)
+ // Implementation of the space filter: limit inlining max code units.
+ ? CompilerOptions::kSpaceFilterInlineMaxCodeUnits
+ : CompilerOptions::kDefaultInlineMaxCodeUnits;
+ }
+
// Checks are all explicit until we know the architecture.
bool implicit_null_checks = false;
bool implicit_so_checks = false;