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

Issue 10800037: New linear scan allocator. (Closed)

Created:
8 years, 5 months ago by Vyacheslav Egorov (Google)
Modified:
8 years, 5 months ago
CC:
reviews_dartlang.org, vm-dev_chromium.org
Visibility:
Public.

Description

New linear scan allocator. Committed: https://code.google.com/p/dart/source/detail?r=9851

Patch Set 1 #

Total comments: 16

Patch Set 2 : refactored liveness computation #

Total comments: 71

Patch Set 3 : address comments #

Patch Set 4 : ia32 #

Patch Set 5 : rebased #

Patch Set 6 : fix one comment #

Total comments: 18

Patch Set 7 : address Kevin's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1333 lines, -578 lines) Patch
M runtime/vm/flow_graph_allocator.h View 1 2 3 4 5 6 8 chunks +201 lines, -128 lines 0 comments Download
M runtime/vm/flow_graph_allocator.cc View 1 2 3 4 5 6 15 chunks +1070 lines, -429 lines 0 comments Download
M runtime/vm/flow_graph_compiler.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph_compiler_ia32.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/growable_array.h View 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 3 4 2 chunks +9 lines, -4 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 4 4 chunks +13 lines, -7 lines 0 comments Download
M runtime/vm/locations.h View 1 2 3 4 5 4 chunks +17 lines, -3 lines 0 comments Download
M runtime/vm/locations.cc View 1 2 3 4 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 11 (0 generated)
Vyacheslav Egorov (Google)
I am uploading this as a preliminary draft. There are still some minor infrastructure pieces ...
8 years, 5 months ago (2012-07-19 16:52:16 UTC) #1
srdjan
Some initial comments http://codereview.chromium.org/10800037/diff/1/runtime/vm/flow_graph_allocator.cc File runtime/vm/flow_graph_allocator.cc (right): http://codereview.chromium.org/10800037/diff/1/runtime/vm/flow_graph_allocator.cc#newcode263 runtime/vm/flow_graph_allocator.cc:263: if (first_use_interval_ == NULL || first_use_interval_->start_ ...
8 years, 5 months ago (2012-07-19 22:54:38 UTC) #2
Vyacheslav Egorov (Google)
I have refactored live range building routine and changed the meaning of positions we assign ...
8 years, 5 months ago (2012-07-20 23:57:36 UTC) #3
srdjan
Some new and some repeated comments. Please apply the comments from my previous reply and ...
8 years, 5 months ago (2012-07-22 15:09:24 UTC) #4
srdjan
I would definitely recommend splitting this CL into several ones in order to make quick ...
8 years, 5 months ago (2012-07-22 23:27:33 UTC) #5
Vyacheslav Egorov (Google)
I am starting to split it to pieces. First piece: spill locations: https://chromiumcodereview.appspot.com/10805053 so that ...
8 years, 5 months ago (2012-07-23 11:48:39 UTC) #6
srdjan
https://chromiumcodereview.appspot.com/10800037/diff/6001/runtime/vm/locations.cc File runtime/vm/locations.cc (right): https://chromiumcodereview.appspot.com/10800037/diff/6001/runtime/vm/locations.cc#newcode59 runtime/vm/locations.cc:59: UNREACHABLE(); On 2012/07/23 11:48:39, Vyacheslav Egorov (Google) wrote: > ...
8 years, 5 months ago (2012-07-23 17:02:50 UTC) #7
Vyacheslav Egorov (Google)
Comments addressed. Rebased. PTAL https://chromiumcodereview.appspot.com/10800037/diff/1/runtime/vm/flow_graph_allocator.cc File runtime/vm/flow_graph_allocator.cc (right): https://chromiumcodereview.appspot.com/10800037/diff/1/runtime/vm/flow_graph_allocator.cc#newcode1054 runtime/vm/flow_graph_allocator.cc:1054: first_unallocated); On 2012/07/19 22:54:39, srdjan ...
8 years, 5 months ago (2012-07-24 12:26:41 UTC) #8
srdjan
LGTM https://chromiumcodereview.appspot.com/10800037/diff/6001/tools/gyp/configurations_make.gypi File tools/gyp/configurations_make.gypi (right): https://chromiumcodereview.appspot.com/10800037/diff/6001/tools/gyp/configurations_make.gypi#newcode4 tools/gyp/configurations_make.gypi:4: On 2012/07/24 12:26:42, Vyacheslav Egorov (Google) wrote: > ...
8 years, 5 months ago (2012-07-24 15:11:19 UTC) #9
Kevin Millikin (Google)
It looks OK. http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_allocator.cc File runtime/vm/flow_graph_allocator.cc (right): http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_allocator.cc#newcode50 runtime/vm/flow_graph_allocator.cc:50: static intptr_t ToParallelMove(intptr_t pos) { I ...
8 years, 5 months ago (2012-07-24 15:20:51 UTC) #10
Vyacheslav Egorov (Google)
8 years, 5 months ago (2012-07-24 16:01:00 UTC) #11
Thanks. Addressed almost all of comments.

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
File runtime/vm/flow_graph_allocator.cc (right):

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:50: static intptr_t ToParallelMove(intptr_t
pos) {
On 2012/07/24 15:20:51, kmillikin wrote:
> I prefer ToPreviousParallelMove.

This would be confusing: if position is the parallel move then result is the
same parallel move, not the one before it.

[this might change if we decide to allow splitting in every position]

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:68: blocked_cpu_regs_[reg] = false;
On 2012/07/24 15:20:51, kmillikin wrote:
> blocked_cpu_regs_ will be zero initialized if you put it in the intializer
list
> :)

Done.

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:251: // Live ranges are being build by
visiting instructions in post-order.
On 2012/07/24 15:20:51, kmillikin wrote:
> That doesn't have anything to do with postorder.  It's just because they are
> visited in reverse of the instruction order (whatever that is).
> 
> I don't know what perpend is, either.

Well we are visiting blocks in post order (and instruction order is actually a
reverse post-order). So I am not sure why you say that this has nothing to do
with post order.

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:435: // All uses are recorded at the position
of parallel move preceding goto.
On 2012/07/24 15:20:51, kmillikin wrote:
> I have a feeling that the implicit and explicit parallel moves are going to
get
> messy.  We should come up with different terminology to describe this one used
> to resolve phis.
> 
> Or if we want to be really cute, fold it into the goto.

There is not distinction between implicit and explicit parallel moves right now.
Every parallel move has a position (even one).

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:495: for (intptr_t j = 0; j < phis->length();
j++) {
On 2012/07/24 15:20:51, kmillikin wrote:
> j?  How about something like phi_idx or phi_index.

Done.

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:508: range->DefineAt(pos);  // Shorten live
range.
On 2012/07/24 15:20:51, kmillikin wrote:
> Is this really shortening it, or is pos == the assumed value?

Actually since pos is equal to start of the block there is no shortening. It's
here just to keep it uniform.

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.cc:510: for (intptr_t k = 0; k <
phi->InputCount(); k++) {
On 2012/07/24 15:20:51, kmillikin wrote:
> k?  How about pred_idx or something.

Done.

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
File runtime/vm/flow_graph_allocator.h (right):

http://codereview.chromium.org/10800037/diff/9016/runtime/vm/flow_graph_alloc...
runtime/vm/flow_graph_allocator.h:114: // parts of interfering live ranges. 
Place non-spilled parts into
On 2012/07/24 15:20:51, kmillikin wrote:
> 'spliting' -> 'splitting'.  Last sentence is a fragment.

Done.

Powered by Google App Engine
This is Rietveld 408576698