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

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

Issue 1105793002: Greedy reg alloc - better splitting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Just a rebase 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.cc » ('j') | src/compiler/register-allocator.cc » ('J')
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 163dd2ca30698ca9dbe997f6912836c5f26c9b80..2fad371d2adc5a281098e98ca426663af019a7c9 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -6,6 +6,7 @@
#define V8_REGISTER_ALLOCATOR_H_
#include "src/compiler/instruction.h"
+#include "src/ostreams.h"
#include "src/zone-containers.h"
namespace v8 {
@@ -152,6 +153,9 @@ class LifetimePosition final {
};
+std::ostream& operator<<(std::ostream& os, const LifetimePosition pos);
+
+
// Representation of the non-empty interval [start,end[.
class UseInterval final : public ZoneObject {
public:
@@ -467,6 +471,13 @@ class LiveRange final : public ZoneObject {
DISALLOW_COPY_AND_ASSIGN(LiveRange);
};
+struct PrintableLiveRange {
+ const RegisterConfiguration* register_configuration_;
+ const LiveRange* range_;
+};
+
+std::ostream& operator<<(std::ostream& os,
+ const PrintableLiveRange printable_range);
dcarney 2015/05/01 07:56:03 we usually use const & for these
Mircea Trofin 2015/05/01 15:06:33 Done.
class SpillRange final : public ZoneObject {
public:
@@ -594,6 +605,22 @@ class RegisterAllocationData final : public ZoneObject {
PhiInstruction* phi);
PhiMapValue* GetPhiMapValueFor(int virtual_register);
+ PrintableInstruction ToPrintable(Instruction* ins) const {
+ return {config_, ins};
+ }
+
+ PrintableInstructionOperand ToPrintable(InstructionOperand op) const {
+ return {config_, op};
+ }
+
+ PrintableInstructionSequence ToPrintable(InstructionSequence* seq) const {
+ return {config_, seq};
+ }
+
+ PrintableLiveRange ToPrintable(LiveRange* range) const {
+ return {config_, range};
+ }
dcarney 2015/05/01 07:56:03 these are dead code (gdb only). drop. in gdb you
Mircea Trofin 2015/05/01 15:06:33 But you still need to construct the Printable{xyz}
+
private:
Zone* const allocation_zone_;
Frame* const frame_;
@@ -839,7 +866,11 @@ class GreedyAllocator final : public RegisterAllocator {
void AllocateRegisters();
private:
+ LifetimePosition GetSplittablePos(LifetimePosition pos);
const RegisterConfiguration* config() const { return data()->config(); }
+ Zone* local_zone() { return local_zone_; }
dcarney 2015/05/01 07:56:03 const
Mircea Trofin 2015/05/01 15:06:33 Done.
+ bool TryReuseSpillForPhi(LiveRange* range);
+ int GetHintedRegister(LiveRange* range);
typedef ZonePriorityQueue<std::pair<unsigned, LiveRange*>> PQueue;
@@ -855,12 +886,17 @@ class GreedyAllocator final : public RegisterAllocator {
bool TryAllocatePhysicalRegister(unsigned reg_id, LiveRange* range,
ZoneSet<LiveRange*>* conflicting);
bool HandleSpillOperands(LiveRange* range);
- bool AllocateBlockedRange(LiveRange*, const ZoneSet<LiveRange*>&);
+ 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<CoallescedLiveRanges*> allocations_;
PQueue queue_;
DISALLOW_COPY_AND_ASSIGN(GreedyAllocator);
« no previous file with comments | « no previous file | src/compiler/register-allocator.cc » ('j') | src/compiler/register-allocator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698