Reviewers: Jarin (OOO), Benedikt Meurer,
Message:
The change may be introduced as a few smaller changes, namely:
- renaming the preprocess-live-ranges.{cc|h} files
- changing spill_ranges() from a ZoneVector to a ZoneSet - this is necessary
because, with the splintering feature, it is possible the same spill range
be
added for future processing (i.e. added to the spill_ranges collection)
because
one or some of the splinters, or the original range (or children of either
of
these) are spilled.
- enabling stack checks in loops - which will bring with it a large
regression
- enabling the splintering change
However, it helps understand how these all fit together, hence this CL.
Once we
are OK with it, splitting it into chunks as shown above should be very
straight-forward.
Description:
[turbofan] Deferred blocks splintering.
This change encompasses what is necessary to enable stack checks in loops
without suffering large regressions.
Primarily, it consists of a new mechanism for dealing with deferred blocks
by
"splintering", rather than splitting, inside deferred blocks.
My initial change was splitting along deferred block boundaries, but the
regression introduced by stackchecks wasn't resolved conclusively. After
investigation, it appears that just splitting ranges along cold block
boundaries
leads to a greater opportunity for moves on the hot path, hence the
suboptimal
outcome.
The alternative "splinters" ranges rather than splitting them. While
splitting
creates 2 ranges and links them (parent-child), in contrast, splintering
creates
a new independent range with no parent-child relation to the original. The
original range appears as if it has a liveness hole in the place of the
splintered one. All thus obtained ranges are then register allocated with no
change to the register allocator.
The splinters (cold blocks) do not conflict with the hot path ranges, by
construction. The hot path ones have less pressure to split, because we
remove a
source of conflicts. After allocation, we merge the splinters back to their
original ranges and continue the pipeline. We leverage the previous changes
made
for deferred blocks (determining where to spill, for example).
BUG=
Please review this at https://codereview.chromium.org/1305393003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+496, -256 lines):
M BUILD.gn
M src/bit-vector.cc
M src/compiler/ast-graph-builder.cc
M src/compiler/instruction.h
M src/compiler/instruction.cc
A + src/compiler/live-range-separator.h
A src/compiler/live-range-separator.cc
M src/compiler/pipeline.cc
D src/compiler/preprocess-live-ranges.h
D src/compiler/preprocess-live-ranges.cc
M src/compiler/register-allocator.h
M src/compiler/register-allocator.cc
M src/flag-definitions.h
M test/unittests/compiler/register-allocator-unittest.cc
M tools/gyp/v8.gyp
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.