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

Issue 2182003002: [turbofan] Fix overly aggressive dead code elimination. (Closed)

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

Description

[turbofan] Fix overly aggressive dead code elimination. When we eliminate nodes during truncation analysis that have no value uses, we must make sure that we do not eliminate speculative number operations that would have side effects depending on the inputs, i.e. for example a SpeculativeNumberMultiply(x,y) does ToNumber(x) and ToNumber(y) first, so if either x or y could throw an exception during ToNumber conversion, we must not eliminate the multiplication, even if it has no value uses (some later pass may kill the actual machine multiplication, but the checks on the inputs have to remain still). So we check whether both x and y are PlainPrimitive, i.e. neither Receiver nor Symbol, which could raise exceptions for ToNumber, and only in that case we propagate the "unusedness" of the node to its inputs. This also uncovered a bug with the type of Dead, which must be None, as this represents an impossible value, so we had to fix that too. Also the dead code removal will not work correctly for constants (i.e. pure nodes with no value inputs), as those might be cached and hence we might resurrect them for an unrelated node lowering during SimplifiedLowering and only later kill the actual node (replacing its uses with Dead), which would then also replace the new use with Dead. So that was fixed as well. This shouldn't change anything for the result, as unused constants automagically disappear from the graph later on anyways. R=yangguo@chromium.org BUG=chromium:631318 Committed: https://crrev.com/32346aaea037f23a6c312c323fcc8ba9673c22aa Cr-Commit-Position: refs/heads/master@{#38038}

Patch Set 1 #

Patch Set 2 : Add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+157 lines, -146 lines) Patch
M src/compiler/simplified-lowering.cc View 1 7 chunks +51 lines, -8 lines 0 comments Download
M src/compiler/typer.cc View 1 chunk +1 line, -3 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-1.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-10.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-11.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-12.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-13.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-14.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-15.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-2.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-3.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-4.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-5.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-6.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-7.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-8.js View 1 chunk +7 lines, -9 lines 0 comments Download
A + test/mjsunit/regress/regress-crbug-631318-9.js View 1 chunk +7 lines, -9 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 13 (7 generated)
Benedikt Meurer
4 years, 4 months ago (2016-07-26 06:37:16 UTC) #1
Benedikt Meurer
Hey Yang, Here's the CL that I told you about offline (with a long description). ...
4 years, 4 months ago (2016-07-26 06:37:55 UTC) #4
Yang
lgtm
4 years, 4 months ago (2016-07-26 06:49:21 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2182003002/20001
4 years, 4 months ago (2016-07-26 06:50:04 UTC) #10
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 4 months ago (2016-07-26 07:07:38 UTC) #11
commit-bot: I haz the power
4 years, 4 months ago (2016-07-26 07:10:06 UTC) #13
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/32346aaea037f23a6c312c323fcc8ba9673c22aa
Cr-Commit-Position: refs/heads/master@{#38038}

Powered by Google App Engine
This is Rietveld 408576698