summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler.cc
diff options
context:
space:
mode:
author Matthew Gharrity <gharrma@google.com> 2016-08-03 16:57:37 -0700
committer Matthew Gharrity <gharrma@google.com> 2016-08-06 01:21:14 +0000
commit2cd05b7d9976c0c7fa74d58cb1608c809e5c37d3 (patch)
tree5cb7751e491aeae7357ed357f2a52702bf16854a /compiler/optimizing/optimizing_compiler.cc
parent11a59a48474caa818ddf344575aa6afc51f45590 (diff)
Add a register allocation strategy compiler option
Test: manually, on device. Change-Id: If007a1657dd5769ddef03691e0a19dbbe6ba1a29
Diffstat (limited to 'compiler/optimizing/optimizing_compiler.cc')
-rw-r--r--compiler/optimizing/optimizing_compiler.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index d5b0d77fe5..30da69ffff 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -546,7 +546,8 @@ void OptimizingCompiler::RunArchOptimizations(InstructionSet instruction_set,
NO_INLINE // Avoid increasing caller's frame size by large stack-allocated objects.
static void AllocateRegisters(HGraph* graph,
CodeGenerator* codegen,
- PassObserver* pass_observer) {
+ PassObserver* pass_observer,
+ RegisterAllocator::Strategy strategy) {
{
PassScope scope(PrepareForRegisterAllocation::kPrepareForRegisterAllocationPassName,
pass_observer);
@@ -559,7 +560,7 @@ static void AllocateRegisters(HGraph* graph,
}
{
PassScope scope(RegisterAllocator::kRegisterAllocatorPassName, pass_observer);
- RegisterAllocator::Create(graph->GetArena(), codegen, liveness)->AllocateRegisters();
+ RegisterAllocator::Create(graph->GetArena(), codegen, liveness, strategy)->AllocateRegisters();
}
}
@@ -626,7 +627,9 @@ void OptimizingCompiler::RunOptimizations(HGraph* graph,
RunOptimizations(optimizations2, arraysize(optimizations2), pass_observer);
RunArchOptimizations(driver->GetInstructionSet(), graph, codegen, pass_observer);
- AllocateRegisters(graph, codegen, pass_observer);
+ RegisterAllocator::Strategy regalloc_strategy =
+ driver->GetCompilerOptions().GetRegisterAllocationStrategy();
+ AllocateRegisters(graph, codegen, pass_observer, regalloc_strategy);
}
static ArenaVector<LinkerPatch> EmitAndSortLinkerPatches(CodeGenerator* codegen) {