From 2cd05b7d9976c0c7fa74d58cb1608c809e5c37d3 Mon Sep 17 00:00:00 2001 From: Matthew Gharrity Date: Wed, 3 Aug 2016 16:57:37 -0700 Subject: Add a register allocation strategy compiler option Test: manually, on device. Change-Id: If007a1657dd5769ddef03691e0a19dbbe6ba1a29 --- compiler/optimizing/optimizing_compiler.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/optimizing_compiler.cc') 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 EmitAndSortLinkerPatches(CodeGenerator* codegen) { -- cgit v1.2.3-59-g8ed1b