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

Issue 1205173002: [turbofan] Greedy allocator refactoring. (Closed)

Created:
5 years, 6 months ago by Mircea Trofin
Modified:
5 years, 5 months ago
CC:
v8-dev, jvoung (off chromium), Jim Stichnoth
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Greedy allocator refactoring. Separated core greedy allocator concepts, exposing the APIs we would want to continue working with. In particular, this change completely reworks CoalescedLiveRanges to reflect the fact that we expect more than one possible conflict, scrapping the initial design of the structure. Since this is a critical part of the design, this change may be thought of as a full rewrite of the algorithm. Reduced all heuristics to just 2 essential ones: split "somewhere", which we'll still need when all other heuristics fail; and spill. Introduced a simple primitive for splitting - at GapPosition::START. The goal is to use such primitives to quickly and reliably author heuristics. I expected this primitive to "just work" for any arbitrary instruction index within a live range - e.g. its middle. That's not the case, it seems to upset execution in certain scenarios. Restricting to either before/after use positions seems to work. I'm still investigating what the source of failures is in the case of "arbitrary instruction in the range" case. I intended to document the rationale and prove the soundness of always using START for splits, but I will postpone to after this last remaining issue is resolved. Committed: https://crrev.com/1cd60451de667199d6195b54f0ea7a1d9f206557 Cr-Commit-Position: refs/heads/master@{#29352}

Patch Set 1 #

Patch Set 2 : #

Total comments: 17

Patch Set 3 : #

Total comments: 1

Patch Set 4 : #

Total comments: 32

Patch Set 5 : #

Patch Set 6 : minor fix on splitting at interval boundaries #

Unified diffs Side-by-side diffs Delta from patch set Stats (+601 lines, -366 lines) Patch
M BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A src/compiler/coalesced-live-ranges.h View 1 2 3 1 chunk +109 lines, -0 lines 0 comments Download
A src/compiler/coalesced-live-ranges.cc View 1 2 3 4 1 chunk +148 lines, -0 lines 0 comments Download
M src/compiler/greedy-allocator.h View 1 2 3 4 3 chunks +67 lines, -22 lines 0 comments Download
M src/compiler/greedy-allocator.cc View 1 2 3 4 5 2 chunks +222 lines, -332 lines 0 comments Download
M src/compiler/register-allocator.h View 1 2 3 4 4 chunks +18 lines, -2 lines 0 comments Download
M src/compiler/register-allocator.cc View 1 2 6 chunks +33 lines, -10 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (6 generated)
titzer
https://codereview.chromium.org/1205173002/diff/20001/src/compiler/coalesced-live-ranges.h File src/compiler/coalesced-live-ranges.h (right): https://codereview.chromium.org/1205173002/diff/20001/src/compiler/coalesced-live-ranges.h#newcode18 src/compiler/coalesced-live-ranges.h:18: struct AllocatedRange { WeightedLiveRange? Should be a class if ...
5 years, 6 months ago (2015-06-24 23:00:08 UTC) #2
titzer
https://codereview.chromium.org/1205173002/diff/20001/src/compiler/greedy-allocator.h File src/compiler/greedy-allocator.h (right): https://codereview.chromium.org/1205173002/diff/20001/src/compiler/greedy-allocator.h#newcode68 src/compiler/greedy-allocator.h:68: void InitializeAllocations(); Why not just name the method after ...
5 years, 6 months ago (2015-06-24 23:05:44 UTC) #3
Benedikt Meurer
https://codereview.chromium.org/1205173002/diff/20001/src/compiler/coalesced-live-ranges.h File src/compiler/coalesced-live-ranges.h (right): https://codereview.chromium.org/1205173002/diff/20001/src/compiler/coalesced-live-ranges.h#newcode16 src/compiler/coalesced-live-ranges.h:16: // TODO(mtrofin): we may be calculating the weight multiple ...
5 years, 6 months ago (2015-06-25 04:41:07 UTC) #5
Mircea Trofin
https://codereview.chromium.org/1205173002/diff/20001/src/compiler/coalesced-live-ranges.h File src/compiler/coalesced-live-ranges.h (right): https://codereview.chromium.org/1205173002/diff/20001/src/compiler/coalesced-live-ranges.h#newcode16 src/compiler/coalesced-live-ranges.h:16: // TODO(mtrofin): we may be calculating the weight multiple ...
5 years, 6 months ago (2015-06-25 23:06:23 UTC) #7
Mircea Trofin
5 years, 6 months ago (2015-06-26 00:03:44 UTC) #8
Jarin
I really like this. If my nits are addressed/answered, it is good to go. It ...
5 years, 5 months ago (2015-06-29 05:25:16 UTC) #9
titzer
https://codereview.chromium.org/1205173002/diff/60001/src/compiler/register-allocator.h File src/compiler/register-allocator.h (right): https://codereview.chromium.org/1205173002/diff/60001/src/compiler/register-allocator.h#newcode481 src/compiler/register-allocator.h:481: int size_; Can you add a only liner explaining ...
5 years, 5 months ago (2015-06-29 11:17:57 UTC) #10
Mircea Trofin
https://codereview.chromium.org/1205173002/diff/60001/src/compiler/coalesced-live-ranges.cc File src/compiler/coalesced-live-ranges.cc (right): https://codereview.chromium.org/1205173002/diff/60001/src/compiler/coalesced-live-ranges.cc#newcode70 src/compiler/coalesced-live-ranges.cc:70: for (; QueryIntersectsAllocatedInterval(query, conflict);) { On 2015/06/29 05:25:15, jarin ...
5 years, 5 months ago (2015-06-29 13:20:16 UTC) #12
Jarin
lgtm from my side.
5 years, 5 months ago (2015-06-29 13:38:03 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1205173002/120001
5 years, 5 months ago (2015-06-29 15:22:17 UTC) #16
commit-bot: I haz the power
Committed patchset #6 (id:120001)
5 years, 5 months ago (2015-06-29 15:56:31 UTC) #17
commit-bot: I haz the power
5 years, 5 months ago (2015-06-29 15:56:40 UTC) #18
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/1cd60451de667199d6195b54f0ea7a1d9f206557
Cr-Commit-Position: refs/heads/master@{#29352}

Powered by Google App Engine
This is Rietveld 408576698