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

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

Issue 1184183002: Separate greedy regalloc in its own files (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/pipeline.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 baffedd919292c93e68b263793f3424c30aa0aaa..5a09c012d8234f42fb24db895130328b9be35b81 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -607,6 +607,7 @@ class RegisterAllocationData final : public ZoneObject {
PhiMapValue* InitializePhiMap(const InstructionBlock* block,
PhiInstruction* phi);
PhiMapValue* GetPhiMapValueFor(int virtual_register);
+ bool IsBlockBoundary(LifetimePosition pos) const;
private:
Zone* const allocation_zone_;
@@ -768,6 +769,8 @@ class RegisterAllocator : public ZoneObject {
LifetimePosition FindOptimalSpillingPos(LiveRange* range,
LifetimePosition pos);
+ const ZoneVector<LiveRange*>& GetFixedRegisters() const;
+
private:
RegisterAllocationData* const data_;
const RegisterKind mode_;
@@ -840,55 +843,6 @@ class LinearScanAllocator final : public RegisterAllocator {
DISALLOW_COPY_AND_ASSIGN(LinearScanAllocator);
};
-class CoalescedLiveRanges;
-
-
-// A variant of the LLVM Greedy Register Allocator. See
-// http://blog.llvm.org/2011/09/greedy-register-allocation-in-llvm-30.html
-class GreedyAllocator final : public RegisterAllocator {
- public:
- explicit GreedyAllocator(RegisterAllocationData* data, RegisterKind kind,
- Zone* local_zone);
-
- void AllocateRegisters();
-
- private:
- LifetimePosition GetSplittablePos(LifetimePosition pos);
- const RegisterConfiguration* config() const { return data()->config(); }
- Zone* local_zone() const { return local_zone_; }
- bool TryReuseSpillForPhi(LiveRange* range);
- int GetHintedRegister(LiveRange* range);
-
- typedef ZonePriorityQueue<std::pair<unsigned, LiveRange*>> PQueue;
-
- unsigned GetLiveRangeSize(LiveRange* range);
- void Enqueue(LiveRange* range);
-
- void Evict(LiveRange* range);
- float CalculateSpillWeight(LiveRange* range);
- float CalculateMaxSpillWeight(const ZoneSet<LiveRange*>& ranges);
-
-
- bool TryAllocate(LiveRange* current, ZoneSet<LiveRange*>* conflicting);
- bool TryAllocatePhysicalRegister(unsigned reg_id, LiveRange* range,
- ZoneSet<LiveRange*>* conflicting);
- bool HandleSpillOperands(LiveRange* range);
- void AllocateBlockedRange(LiveRange* current, LifetimePosition pos,
- bool spill);
-
- LiveRange* SpillBetweenUntil(LiveRange* range, LifetimePosition start,
- LifetimePosition until, LifetimePosition end);
- void AssignRangeToRegister(int reg_id, LiveRange* range);
-
- LifetimePosition FindProgressingSplitPosition(LiveRange* range,
- bool* is_spill_pos);
-
- Zone* local_zone_;
- ZoneVector<CoalescedLiveRanges*> allocations_;
- PQueue queue_;
- DISALLOW_COPY_AND_ASSIGN(GreedyAllocator);
-};
-
class SpillSlotLocator final : public ZoneObject {
public:
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698