diff options
| author | Vladimir Marko <vmarko@google.com> | 2017-10-09 13:39:07 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-10-09 13:39:07 +0000 |
| commit | 96c6c151693c37de5edaacc5705088dcddeb6aff (patch) | |
| tree | f01f37bcb113ccbb2e3a5bc8b99989c01433b4a0 /compiler/optimizing/codegen_test_utils.h | |
| parent | 2e517cf7cb04f6bcbba9fe47b09d69182a40b477 (diff) | |
| parent | bc0c57fe3221288d650e11ece258931797a3c381 (diff) | |
Merge "Use ScopedArenaAllocator for register allocation." am: 0967cd9486 am: 5eeba2f9d7 am: 9a99e3cee2
am: bc0c57fe32
Change-Id: I71c6f7adbe47983864e2b1406829cfbc3b0b6f2a
Diffstat (limited to 'compiler/optimizing/codegen_test_utils.h')
| -rw-r--r-- | compiler/optimizing/codegen_test_utils.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/optimizing/codegen_test_utils.h b/compiler/optimizing/codegen_test_utils.h index 5f4593ff0e4..bcbcc12349a 100644 --- a/compiler/optimizing/codegen_test_utils.h +++ b/compiler/optimizing/codegen_test_utils.h @@ -295,10 +295,15 @@ static void RunCodeNoCheck(CodeGenerator* codegen, const std::function<void(HGraph*)>& hook_before_codegen, bool has_result, Expected expected) { - SsaLivenessAnalysis liveness(graph, codegen); - PrepareForRegisterAllocation(graph).Run(); - liveness.Analyze(); - RegisterAllocator::Create(graph->GetAllocator(), codegen, liveness)->AllocateRegisters(); + { + ScopedArenaAllocator local_allocator(graph->GetArenaStack()); + SsaLivenessAnalysis liveness(graph, codegen, &local_allocator); + PrepareForRegisterAllocation(graph).Run(); + liveness.Analyze(); + std::unique_ptr<RegisterAllocator> register_allocator = + RegisterAllocator::Create(&local_allocator, codegen, liveness); + register_allocator->AllocateRegisters(); + } hook_before_codegen(graph); InternalCodeAllocator allocator; codegen->Compile(&allocator); |
