Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: src/compiler/pipeline.cc

Issue 1061923005: Reland: Introducing the LLVM greedy register allocator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/register-allocator.h » ('j') | src/compiler/register-allocator.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/pipeline.cc
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc
index 59684c1ac10d2fca9bc7ae65b2a77d72cbcba910..0d28dafb708d5f50121a4c8ee14c216c912218f4 100644
--- a/src/compiler/pipeline.cc
+++ b/src/compiler/pipeline.cc
@@ -742,23 +742,25 @@ struct BuildLiveRangesPhase {
};
+template <typename RegAllocator>
struct AllocateGeneralRegistersPhase {
static const char* phase_name() { return "allocate general registers"; }
void Run(PipelineData* data, Zone* temp_zone) {
- LinearScanAllocator allocator(data->register_allocation_data(),
- GENERAL_REGISTERS, temp_zone);
+ RegAllocator allocator(data->register_allocation_data(), GENERAL_REGISTERS,
+ temp_zone);
allocator.AllocateRegisters();
}
};
+template <typename RegAllocator>
struct AllocateDoubleRegistersPhase {
static const char* phase_name() { return "allocate double registers"; }
void Run(PipelineData* data, Zone* temp_zone) {
- LinearScanAllocator allocator(data->register_allocation_data(),
- DOUBLE_REGISTERS, temp_zone);
+ RegAllocator allocator(data->register_allocation_data(), DOUBLE_REGISTERS,
+ temp_zone);
allocator.AllocateRegisters();
}
};
@@ -1269,8 +1271,13 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
if (verifier != nullptr) {
CHECK(!data->register_allocation_data()->ExistsUseWithoutDefinition());
}
- Run<AllocateGeneralRegistersPhase>();
- Run<AllocateDoubleRegistersPhase>();
+ if (FLAG_turbo_greedy_regalloc) {
+ Run<AllocateGeneralRegistersPhase<GreedyAllocator>>();
+ Run<AllocateDoubleRegistersPhase<GreedyAllocator>>();
+ } else {
+ Run<AllocateGeneralRegistersPhase<LinearScanAllocator>>();
+ Run<AllocateDoubleRegistersPhase<LinearScanAllocator>>();
+ }
Run<AssignSpillSlotsPhase>();
Run<CommitAssignmentPhase>();
« no previous file with comments | « no previous file | src/compiler/register-allocator.h » ('j') | src/compiler/register-allocator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698