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

Issue 1193833002: [turbofan] Proper dead code elimination as regular reducer. (Closed)

Created:
5 years, 6 months ago by Benedikt Meurer
Modified:
5 years, 6 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Proper dead code elimination as regular reducer. The three different concerns that the ControlReducer used to deal with are now properly separated into a.) DeadCodeElimination, which is a regular AdvancedReducer, that propagates Dead via control edges, b.) CommonOperatorReducer, which does strength reduction on common operators (i.e. Branch, Phi, and friends), and c.) GraphTrimming, which removes dead->live edges from the graph. This will make it possible to run the DeadCodeElimination together with other passes that actually introduce Dead nodes, i.e. typed lowering; and it opens the door for general inlining without two stage fix point iteration. To make the DeadCodeElimination easier and more uniform, we basically reverted the introduction of DeadValue and DeadEffect, and changed the Dead operator to produce control, value and effect. Note however that this is not a requirement, but merely a way to make dead propagation easier and more uniform. We could always go back and decide to have different Dead operators if some other change requires that. Note that there are several additional opportunities for cleanup now, i.e. OSR deconstruction could be a regular reducer now, and we don't need to use TheHole as dead value marker in the GraphReducer. And we can actually run the dead code elimination together with the other passes instead of using separate passes over the graph. We will do this in follow up CLs. R=jarin@chromium.org, mstarzinger@chromium.org Committed: https://crrev.com/733a2463865c8db539d8c71dabdb7e8a3cc8de0a Cr-Commit-Position: refs/heads/master@{#29146}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Renamed DeadControl to Dead. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+947 lines, -1707 lines) Patch
M BUILD.gn View 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler/ast-graph-builder.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler/ast-graph-builder.cc View 1 4 chunks +6 lines, -5 lines 0 comments Download
M src/compiler/common-operator.h View 2 chunks +1 line, -4 lines 0 comments Download
M src/compiler/common-operator.cc View 1 chunk +1 line, -3 lines 0 comments Download
M src/compiler/common-operator-reducer.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/compiler/common-operator-reducer.cc View 3 chunks +99 lines, -4 lines 0 comments Download
D src/compiler/control-reducer.h View 1 chunk +0 lines, -39 lines 0 comments Download
D src/compiler/control-reducer.cc View 1 chunk +0 lines, -328 lines 0 comments Download
A src/compiler/dead-code-elimination.h View 1 chunk +52 lines, -0 lines 0 comments Download
A src/compiler/dead-code-elimination.cc View 1 chunk +145 lines, -0 lines 0 comments Download
M src/compiler/graph-visualizer.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/js-graph.h View 1 2 chunks +3 lines, -7 lines 0 comments Download
M src/compiler/js-graph.cc View 1 1 chunk +2 lines, -7 lines 0 comments Download
M src/compiler/js-inlining.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler/loop-peeling.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/opcodes.h View 3 chunks +2 lines, -5 lines 0 comments Download
M src/compiler/operator-properties.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/osr.cc View 1 3 chunks +24 lines, -10 lines 0 comments Download
M src/compiler/pipeline.cc View 1 4 chunks +17 lines, -5 lines 0 comments Download
M src/compiler/simplified-lowering.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/typer.cc View 4 chunks +5 lines, -13 lines 0 comments Download
M src/compiler/verifier.cc View 1 chunk +1 line, -3 lines 0 comments Download
M test/cctest/cctest.gyp View 1 chunk +0 lines, -1 line 0 comments Download
D test/cctest/compiler/test-control-reducer.cc View 1 chunk +0 lines, -1119 lines 0 comments Download
M test/cctest/compiler/test-loop-analysis.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/unittests/compiler/common-operator-reducer-unittest.cc View 4 chunks +182 lines, -2 lines 0 comments Download
M test/unittests/compiler/common-operator-unittest.cc View 1 chunk +2 lines, -4 lines 0 comments Download
D test/unittests/compiler/control-reducer-unittest.cc View 1 chunk +0 lines, -126 lines 0 comments Download
A test/unittests/compiler/dead-code-elimination-unittest.cc View 1 chunk +375 lines, -0 lines 0 comments Download
M test/unittests/compiler/graph-reducer-unittest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M test/unittests/compiler/graph-trimmer-unittest.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M test/unittests/compiler/node-properties-unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/unittests/compiler/node-test-utils.h View 1 chunk +1 line, -0 lines 0 comments Download
M test/unittests/compiler/node-test-utils.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M test/unittests/unittests.gyp View 1 chunk +1 line, -1 line 0 comments Download
M tools/gyp/v8.gyp View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
Benedikt Meurer
5 years, 6 months ago (2015-06-19 08:11:46 UTC) #1
Benedikt Meurer
Hey Michi, Jaro, This is the key change to make dead code elimination play well ...
5 years, 6 months ago (2015-06-19 08:13:07 UTC) #2
Jarin
lgtm (although I do not pretend I really understand the OSR magic) https://codereview.chromium.org/1193833002/diff/1/src/compiler/dead-code-elimination.cc File src/compiler/dead-code-elimination.cc ...
5 years, 6 months ago (2015-06-19 09:50:51 UTC) #3
Benedikt Meurer
https://codereview.chromium.org/1193833002/diff/1/src/compiler/dead-code-elimination.cc File src/compiler/dead-code-elimination.cc (right): https://codereview.chromium.org/1193833002/diff/1/src/compiler/dead-code-elimination.cc#newcode52 src/compiler/dead-code-elimination.cc:52: if (live_input_count == 0) { I guess this can ...
5 years, 6 months ago (2015-06-19 09:55:31 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1193833002/20001
5 years, 6 months ago (2015-06-19 12:05:14 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 6 months ago (2015-06-19 12:07:24 UTC) #8
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/733a2463865c8db539d8c71dabdb7e8a3cc8de0a Cr-Commit-Position: refs/heads/master@{#29146}
5 years, 6 months ago (2015-06-19 12:07:36 UTC) #9
Jarin
5 years, 6 months ago (2015-06-19 12:12:11 UTC) #10
Message was sent while issue was closed.
https://codereview.chromium.org/1193833002/diff/1/src/compiler/dead-code-elim...
File src/compiler/dead-code-elimination.cc (right):

https://codereview.chromium.org/1193833002/diff/1/src/compiler/dead-code-elim...
src/compiler/dead-code-elimination.cc:52: if (live_input_count == 0) {
On 2015/06/19 09:55:31, Benedikt Meurer wrote:
> I guess this can never happen. But I wanted to keep the existing functionality
> of the ControlReducer. Maybe we want to replace this with a CHECK at some
point?

Indeed, that was my thinking...

Powered by Google App Engine
This is Rietveld 408576698