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

Issue 1311983002: [turbofan] Separate LiveRange and TopLevelLiveRange concepts (Closed)

Created:
5 years, 4 months ago by Mircea Trofin
Modified:
5 years, 3 months ago
Reviewers:
Benedikt Meurer, Jarin
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

[turbofan] Separate LiveRange and TopLevelLiveRange concepts A TopLevelLiveRange is the live range of a virtual register. Through register allocation, it may end up being split in a succession of child live ranges, where data flow is handled through moves from predecessor to successor child. Today, the concepts of "top level" and "child" live ranges are conflated under the LiveRange class. However, a good few APIs pertain solely to TopLevelLiveRanges. This was communicated through comments or DCHECKs - but this makes for poor code comprehensibility and maintainability. For example, the worklist of the register allocator (live_ranges()) needs to only contain TopLevelLiveRanges; spill range concerns are associated only with the top range; phi-ness; certain phases in the allocation pipeline; APIs on LiveRange used for initial construction - before splitting; splintering - these are all responsibilities associated to TopLevelLiveRanges, and not child live ranges. This change separates the concepts. An effect of this change is that child live range allocation need not involve RegisterAllocationData. That's "a good thing" (lower coupling), but it has the side-effect of not having a good way to construct unique identifiers for child live ranges, relative to a given InstructionSequence. LiveRange Id are used primarily for tracing/output-ing, and debugging. I propose a 2-component identifier: a virtual register (vreg) number, uniquely identifying TopLevelLiveRanges; and a relative identifier, which uniquely identifies children of a given TopLevelLiveRange. "0" is reserved for the TopLevel range. The relative identifier does not necessarily indicate order in the child chain, which is no worse than the current state of affairs. I believe this change should make it easier to understand a trace output (because the virtual register number is readily available). I plan to formalize with a small structure the notion of live range id, and consolidate tracing around that, as part of a separate CL. (there are seemingly disparate ways to trace - printf or stream-based APIs - so this seems like an opportune change to consolidate that) Committed: https://crrev.com/0ee4b473681f3059a3da303ceb6fe23eef37aed3 Cr-Commit-Position: refs/heads/master@{#30370}

Patch Set 1 : #

Total comments: 6

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+811 lines, -728 lines) Patch
M src/compiler/graph-visualizer.cc View 3 chunks +20 lines, -13 lines 0 comments Download
M src/compiler/greedy-allocator.cc View 11 chunks +24 lines, -18 lines 0 comments Download
M src/compiler/live-range-separator.cc View 4 chunks +9 lines, -8 lines 0 comments Download
M src/compiler/register-allocator.h View 1 22 chunks +191 lines, -168 lines 0 comments Download
M src/compiler/register-allocator.cc View 1 73 chunks +561 lines, -517 lines 0 comments Download
M test/unittests/compiler/coalesced-live-ranges-unittest.cc View 3 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 13 (7 generated)
Mircea Trofin
5 years, 4 months ago (2015-08-26 00:22:04 UTC) #6
Benedikt Meurer
LGTM with comments. On a related note: Please make sure that your CL description lines ...
5 years, 3 months ago (2015-08-26 04:31:20 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1311983002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1311983002/100001
5 years, 3 months ago (2015-08-26 05:00:09 UTC) #10
Mircea Trofin
Addressed feedback. https://codereview.chromium.org/1311983002/diff/80001/src/compiler/register-allocator.cc File src/compiler/register-allocator.cc (right): https://codereview.chromium.org/1311983002/diff/80001/src/compiler/register-allocator.cc#newcode2027 src/compiler/register-allocator.cc:2027: auto range = data()->GetOrCreateLiveRangeFor(operand_index); On 2015/08/26 04:31:20, ...
5 years, 3 months ago (2015-08-26 05:00:13 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:100001)
5 years, 3 months ago (2015-08-26 05:22:29 UTC) #12
commit-bot: I haz the power
5 years, 3 months ago (2015-08-26 05:22:46 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/0ee4b473681f3059a3da303ceb6fe23eef37aed3
Cr-Commit-Position: refs/heads/master@{#30370}

Powered by Google App Engine
This is Rietveld 408576698