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

Issue 1061923005: Reland: Introducing the LLVM greedy register allocator. (Closed)

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

Description

Reland: Introducing the LLVM greedy register allocator. This change aims to introduce the separation of the RegisterAllocator model, using the initial prototype for GreedyAllocator as proof of concept. Summary: - new flag, turbo-greedy-regalloc, enabling the new allocator. Default false. - initial, untested implementation for the GreedyAllocator. BUG= Committed: https://crrev.com/f3c04acad80e9346ec4e5435625aee8e3404fcdb Cr-Commit-Position: refs/heads/master@{#28018}

Patch Set 1 : #

Total comments: 28

Patch Set 2 : #

Total comments: 20

Patch Set 3 : #

Total comments: 23

Patch Set 4 : #

Patch Set 5 : Redo after refactoring #

Total comments: 10

Patch Set 6 : After 2nd rebase #

Patch Set 7 : Small fix (DCHECK dissapearing in retail builds) #

Patch Set 8 : win fix #

Patch Set 9 : #

Total comments: 2

Patch Set 10 : #

Patch Set 11 : #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+416 lines, -20 lines) Patch
M src/compiler/pipeline.cc View 1 2 3 4 5 2 chunks +13 lines, -6 lines 0 comments Download
M src/compiler/register-allocator.h View 1 2 3 4 5 6 7 8 9 5 chunks +46 lines, -5 lines 0 comments Download
M src/compiler/register-allocator.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +345 lines, -9 lines 7 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M src/zone-containers.h View 1 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 50 (19 generated)
Mircea Trofin
5 years, 8 months ago (2015-04-17 00:33:46 UTC) #7
Mircea Trofin
Fix incorrect use of DCHECK
5 years, 8 months ago (2015-04-17 00:45:02 UTC) #8
Mircea Trofin
few small fixes
5 years, 8 months ago (2015-04-17 05:33:19 UTC) #12
dcarney
first round of comments: mostly to do with v8 style/peculiarities https://codereview.chromium.org/1061923005/diff/160001/src/compiler/register-allocator.cc File src/compiler/register-allocator.cc (right): https://codereview.chromium.org/1061923005/diff/160001/src/compiler/register-allocator.cc#newcode13 ...
5 years, 8 months ago (2015-04-17 07:22:46 UTC) #13
Mircea Trofin
Incorporated feedback. Also added a ZonePriorityQueue. https://codereview.chromium.org/1061923005/diff/160001/src/compiler/register-allocator.cc File src/compiler/register-allocator.cc (right): https://codereview.chromium.org/1061923005/diff/160001/src/compiler/register-allocator.cc#newcode13 src/compiler/register-allocator.cc:13: const std::pair<int, int> ...
5 years, 8 months ago (2015-04-17 19:23:34 UTC) #15
dcarney
you still have a bunch of places where you are comparing against zero/null without making ...
5 years, 8 months ago (2015-04-18 19:01:33 UTC) #16
Mircea Trofin
Thanks! I think I managed to squash all the remaining style violations now (fingers crossed!) ...
5 years, 8 months ago (2015-04-19 04:02:04 UTC) #19
dcarney
Okay, style-wise you're looking good. I don't want to comment on the implementation of GreedyAllocator ...
5 years, 8 months ago (2015-04-19 12:21:02 UTC) #20
dcarney
> I agree with you, in the short term, it's safest to leave the current ...
5 years, 8 months ago (2015-04-19 12:51:10 UTC) #21
Mircea Trofin
https://codereview.chromium.org/1061923005/diff/250001/src/compiler/register-allocator.cc File src/compiler/register-allocator.cc (right): https://codereview.chromium.org/1061923005/diff/250001/src/compiler/register-allocator.cc#newcode20 src/compiler/register-allocator.cc:20: class RegisterAllocationInfo : public ZoneObject { On 2015/04/19 12:21:01, ...
5 years, 8 months ago (2015-04-19 16:13:39 UTC) #22
dcarney
https://codereview.chromium.org/1061923005/diff/250001/src/compiler/register-allocator.cc File src/compiler/register-allocator.cc (right): https://codereview.chromium.org/1061923005/diff/250001/src/compiler/register-allocator.cc#newcode1896 src/compiler/register-allocator.cc:1896: DCHECK(size); On 2015/04/19 16:13:38, Mircea Trofin wrote: > On ...
5 years, 8 months ago (2015-04-19 18:56:54 UTC) #23
dcarney
quick update i'm currently splitting the register allocator into little pieces, which will make your ...
5 years, 8 months ago (2015-04-20 11:07:48 UTC) #24
dcarney
okay, phase one of the refactor is here and will land soon: https://codereview.chromium.org/1094063002/ this is ...
5 years, 8 months ago (2015-04-20 15:40:50 UTC) #25
Mircea Trofin
Updated after the refactoring. Consolidated some common functionality into helper utility functions (see GetRegisterCount and ...
5 years, 8 months ago (2015-04-20 18:31:44 UTC) #26
dcarney
On 2015/04/20 18:31:44, Mircea Trofin wrote: > Updated after the refactoring. > > Consolidated some ...
5 years, 8 months ago (2015-04-20 19:04:06 UTC) #27
dcarney
okay, please refactor one more time after https://codereview.chromium.org/1100713003/ lands. you'll just need to extend RegisterAllocator ...
5 years, 8 months ago (2015-04-21 12:59:40 UTC) #28
Mircea Trofin
5 years, 8 months ago (2015-04-21 18:10:39 UTC) #30
Mircea Trofin
5 years, 8 months ago (2015-04-21 18:22:06 UTC) #31
jvoung (off chromium)
Throwing out some random nits from the CC list. https://codereview.chromium.org/1061923005/diff/290001/src/compiler/register-allocator.cc File src/compiler/register-allocator.cc (right): https://codereview.chromium.org/1061923005/diff/290001/src/compiler/register-allocator.cc#newcode2642 src/compiler/register-allocator.cc:2642: ...
5 years, 8 months ago (2015-04-21 23:34:07 UTC) #33
Mircea Trofin
Incorporated Jan's feedback. https://codereview.chromium.org/1061923005/diff/290001/src/compiler/register-allocator.cc File src/compiler/register-allocator.cc (right): https://codereview.chromium.org/1061923005/diff/290001/src/compiler/register-allocator.cc#newcode2642 src/compiler/register-allocator.cc:2642: // GetLiveRangeSize is DCHECK-ed to not ...
5 years, 8 months ago (2015-04-22 04:37:33 UTC) #34
dcarney
lgtm, after the below comments are done you should be able to check the cq ...
5 years, 8 months ago (2015-04-22 07:07:24 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1061923005/410001
5 years, 8 months ago (2015-04-22 15:10:43 UTC) #39
Mircea Trofin
Done - sorry about the ordering, I interpreted your previous feedback as referring to ordering ...
5 years, 8 months ago (2015-04-22 15:12:31 UTC) #40
commit-bot: I haz the power
Committed patchset #10 (id:410001)
5 years, 8 months ago (2015-04-22 15:37:42 UTC) #41
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/ec542dea6b6a0cb82d1578a389569d019a59121d Cr-Commit-Position: refs/heads/master@{#28015}
5 years, 8 months ago (2015-04-22 15:37:58 UTC) #42
arv (Not doing code reviews)
A revert of this CL (patchset #10 id:410001) has been created in https://codereview.chromium.org/1080953006/ by arv@chromium.org. ...
5 years, 8 months ago (2015-04-22 17:00:22 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1061923005/430001
5 years, 8 months ago (2015-04-22 18:30:27 UTC) #46
Mircea Trofin
Static initializer fix
5 years, 8 months ago (2015-04-22 18:30:58 UTC) #47
commit-bot: I haz the power
Committed patchset #11 (id:430001)
5 years, 8 months ago (2015-04-22 19:40:01 UTC) #48
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/f3c04acad80e9346ec4e5435625aee8e3404fcdb Cr-Commit-Position: refs/heads/master@{#28018}
5 years, 8 months ago (2015-04-22 19:40:17 UTC) #49
dcarney
5 years, 8 months ago (2015-04-23 12:41:49 UTC) #50
Message was sent while issue was closed.
adding a few comments i left out before because i wanted to get this landed. 
Please address them in a followup cl at some point. no hurry

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
File src/compiler/register-allocator.cc (right):

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
src/compiler/register-allocator.cc:2195: 
two spaces here, and between pretty much everything except in class definitions

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
src/compiler/register-allocator.cc:2282: 
two spaces

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
src/compiler/register-allocator.cc:2308: 
two spaces

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
src/compiler/register-allocator.cc:2347: //
LinearScanAllocator::AllocateRegisters
remove this comment. we want as little consolidation as possible between the
allocators from now on i think, since they should have very little in common

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
src/compiler/register-allocator.cc:2391: allocations_[i] = new (zone)
CoallescedLiveRanges(zone);
these should go in the local zone, which you have on GreedyAllocator
construction. you can get it from allocations.get_allocator().zone()

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
src/compiler/register-allocator.cc:2430: BitVector* assigned_registers = new
(zone) BitVector(num_registers(), zone);
this is actually a bug, the assigned_registers should be in the code_zone(), but
actually they already are there on RegisterAllocationData

it's wrong to reset them on the frame below since they acquire some data during
constraintbuilding, just mark the correct bits in the below loop, something like

  if (mode == DOUBLE_REGISTERS) {
    data()->assigned_double_registers()->Add(i);
  } else {
    data()->assigned_registers()->Add(i);
  }

https://codereview.chromium.org/1061923005/diff/430001/src/compiler/register-...
src/compiler/register-allocator.cc:2436:
data()->frame()->SetAllocatedRegisters(assigned_registers);
remove

Powered by Google App Engine
This is Rietveld 408576698