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

Unified Diff: src/compiler/register-allocator.h

Issue 1312473018: [turbofan] Greedy: live range grouping. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « src/compiler/greedy-allocator.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.h
diff --git a/src/compiler/register-allocator.h b/src/compiler/register-allocator.h
index a2171cafaaae2e7274cfbb536769ca079510d8af..117ddedbcd2a586337b9f68aee239af3333d4c4c 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -275,6 +275,7 @@ class UsePosition final : public ZoneObject {
class SpillRange;
class RegisterAllocationData;
class TopLevelLiveRange;
+class LiveRangeGroup;
// Representation of SSA values' live ranges as a collection of (continuous)
// intervals over the instruction ordering.
@@ -384,6 +385,8 @@ class LiveRange : public ZoneObject {
unsigned GetSize();
float weight() const { return weight_; }
void set_weight(float weight) { weight_ = weight; }
+ LiveRangeGroup* group() const { return group_; }
+ void set_group(LiveRangeGroup* group) { group_ = group; }
static const int kInvalidSize = -1;
static const float kInvalidWeight;
@@ -431,10 +434,30 @@ class LiveRange : public ZoneObject {
// register and ranges that intersect them and need a register.
float weight_;
+ // greedy: groupping
+ LiveRangeGroup* group_;
+
DISALLOW_COPY_AND_ASSIGN(LiveRange);
};
+class LiveRangeGroup final : public ZoneObject {
+ public:
+ explicit LiveRangeGroup(Zone* zone) : ranges_(zone) {}
+ ZoneVector<LiveRange*>& ranges() { return ranges_; }
+ const ZoneVector<LiveRange*>& ranges() const { return ranges_; }
+
+ // TODO(mtrofin): populate assigned register and use in weight calculation.
+ int assigned_register() const { return assigned_register_; }
+ void set_assigned_register(int reg) { assigned_register_ = reg; }
+
+ private:
+ ZoneVector<LiveRange*> ranges_;
+ int assigned_register_;
+ DISALLOW_COPY_AND_ASSIGN(LiveRangeGroup);
+};
+
+
class TopLevelLiveRange final : public LiveRange {
public:
explicit TopLevelLiveRange(int vreg, MachineType machine_type);
« no previous file with comments | « src/compiler/greedy-allocator.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698