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

Issue 1376293005: [turbofan] Redundant branch elimination. (Closed)

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

Description

[turbofan] Redundant branch elimination. Removes a branch that checks for a condition that has been checked on dominators of the branch. This introduces a new reducer that propagates the list of checked conditions (and their boolean values) through the control flow graph. If it encounters a branch checking a condition with a known value, the branch is eliminated. The analysis relies on loops being reducible: if a condition has been checked on all paths to loop entry, then it is checked in the loop (regardless what of the conditions checked inside the loop). The implementation is fairly naive and could be improved: - all the operation on the condition lists could be made allocation-free when revisited. - we could try to use a map structure rather than a linked list (to make lookups faster). - the merging of control flow could be changed to take into account conditions from non-dominating paths (as long as all paths check the condition). Committed: https://crrev.com/106aecf26200188647ea22c2d142067113d496b8 Cr-Commit-Position: refs/heads/master@{#31347}

Patch Set 1 #

Patch Set 2 : Simple tests #

Patch Set 3 : Test #

Patch Set 4 : Check equality on update, comment goodness #

Patch Set 5 : Make IfTrue/IfFalse branch dead based on condition #

Patch Set 6 : Get rid of the eliminated branch #

Patch Set 7 : Loop test #

Total comments: 3

Patch Set 8 : Switched to unsorted linked lists. #

Patch Set 9 : Rename branch-condition-elimination to branch-elimination #

Patch Set 10 : Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+595 lines, -0 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
A src/compiler/branch-elimination.h View 1 2 3 4 5 6 7 8 9 1 chunk +97 lines, -0 lines 0 comments Download
A src/compiler/branch-elimination.cc View 1 2 3 4 5 6 7 8 9 1 chunk +269 lines, -0 lines 0 comments Download
M src/compiler/pipeline.cc View 1 2 3 4 5 6 7 8 3 chunks +20 lines, -0 lines 0 comments Download
A test/unittests/compiler/branch-elimination-unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +204 lines, -0 lines 0 comments Download
M test/unittests/unittests.gyp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
titzer
https://codereview.chromium.org/1376293005/diff/120001/src/compiler/branch-condition-elimination.h File src/compiler/branch-condition-elimination.h (right): https://codereview.chromium.org/1376293005/diff/120001/src/compiler/branch-condition-elimination.h#newcode47 src/compiler/branch-condition-elimination.h:47: class ControlPathConditions { The number of control path conditions ...
5 years, 2 months ago (2015-10-08 18:01:08 UTC) #3
Jarin
https://codereview.chromium.org/1376293005/diff/120001/src/compiler/branch-condition-elimination.h File src/compiler/branch-condition-elimination.h (right): https://codereview.chromium.org/1376293005/diff/120001/src/compiler/branch-condition-elimination.h#newcode47 src/compiler/branch-condition-elimination.h:47: class ControlPathConditions { On 2015/10/08 18:01:07, titzer wrote: > ...
5 years, 2 months ago (2015-10-09 05:28:08 UTC) #4
Jarin
I have changed to unsorted lists and renamed to BranchElimination. https://codereview.chromium.org/1376293005/diff/120001/src/compiler/branch-condition-elimination.h File src/compiler/branch-condition-elimination.h (right): https://codereview.chromium.org/1376293005/diff/120001/src/compiler/branch-condition-elimination.h#newcode47 ...
5 years, 2 months ago (2015-10-17 14:18:21 UTC) #5
titzer
On 2015/10/17 14:18:21, Jarin wrote: > I have changed to unsorted lists and renamed to ...
5 years, 2 months ago (2015-10-17 15:38:00 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1376293005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1376293005/180001
5 years, 2 months ago (2015-10-17 17:49:05 UTC) #8
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 2 months ago (2015-10-17 17:50:17 UTC) #9
commit-bot: I haz the power
5 years, 2 months ago (2015-10-17 17:50:40 UTC) #10
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/106aecf26200188647ea22c2d142067113d496b8
Cr-Commit-Position: refs/heads/master@{#31347}

Powered by Google App Engine
This is Rietveld 408576698