summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_options.cc
diff options
context:
space:
mode:
authorWojciech Staszkiewicz <staszkiewicz@google.com>2016-08-01 17:48:59 -0700
committerWojciech Staszkiewicz <staszkiewicz@google.com>2016-08-08 11:24:26 -0700
commit5319d3cca5a9b8e9e3f59421818272b966575172 (patch)
treea90bd83b7e69bbff0be601088bb1c764125d8cf6 /compiler/driver/compiler_options.cc
parent9cff32df754c428ef69ddb61e7600abfd4c75266 (diff)
Implement running user defined list of passes
This change introduces new dex2oat switch --run-passes=. This switch accepts path to a text file with names of passes to run. Compiler will run optimization passes specified in the file rather then the default ones. There is no verification implemented on the compiler side. It is user's responsibility to provide a list of passes that leads to successful generation of correct code. Care should be taken to prepare a list that satisfies all dependencies between optimizations. We only take control of the optional optimizations. Codegen (builder), and all passes required for register allocation will run unaffected by this mechanism. Change-Id: Ic3694e53515fefcc5ce6f28d9371776b5afcbb4f
Diffstat (limited to 'compiler/driver/compiler_options.cc')
-rw-r--r--compiler/driver/compiler_options.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc
index a522e0c7b5..30ba8c9e74 100644
--- a/compiler/driver/compiler_options.cc
+++ b/compiler/driver/compiler_options.cc
@@ -45,7 +45,8 @@ CompilerOptions::CompilerOptions()
dump_cfg_file_name_(""),
dump_cfg_append_(false),
force_determinism_(false),
- register_allocation_strategy_(RegisterAllocator::kRegisterAllocatorDefault) {
+ register_allocation_strategy_(RegisterAllocator::kRegisterAllocatorDefault),
+ passes_to_run_(nullptr) {
}
CompilerOptions::~CompilerOptions() {
@@ -76,7 +77,8 @@ CompilerOptions::CompilerOptions(CompilerFilter::Filter compiler_filter,
const std::string& dump_cfg_file_name,
bool dump_cfg_append,
bool force_determinism,
- RegisterAllocator::Strategy regalloc_strategy
+ RegisterAllocator::Strategy regalloc_strategy,
+ const std::vector<std::string>* passes_to_run
) : // NOLINT(whitespace/parens)
compiler_filter_(compiler_filter),
huge_method_threshold_(huge_method_threshold),
@@ -102,7 +104,8 @@ CompilerOptions::CompilerOptions(CompilerFilter::Filter compiler_filter,
dump_cfg_file_name_(dump_cfg_file_name),
dump_cfg_append_(dump_cfg_append),
force_determinism_(force_determinism),
- register_allocation_strategy_(regalloc_strategy) {
+ register_allocation_strategy_(regalloc_strategy),
+ passes_to_run_(passes_to_run) {
}
void CompilerOptions::ParseHugeMethodMax(const StringPiece& option, UsageFn Usage) {