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

Issue 2251833002: [turbofan] Only do value numbering when types are compatible. (Closed)

Created:
4 years, 4 months ago by Jarin
Modified:
4 years, 4 months ago
Reviewers:
neis, ahaas
CC:
Benedikt Meurer, 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] Only do value numbering when types are compatible. At the moment, two NumberConstant nodes get different type even if their value is the same because we always allocate a new heap number for each number constant. This can lead to replacing a node with a node of disjoint type in value numbering, which can result in incorrect code down the line because of inconsistent types. This fix makes sure that we only replace a node with a sub-type node. Once we introduce a proper type for number constants, we can move back to the intersection typing in value numbering. Unfortunately, it is quite hard to write a repro for this because we cache NumberConstant nodes. We only throw away cached values that have too many conflicts (>5), so the test has to contain values that fall into the same bucket. That's where the magic floating point numbers in the test come from (they have the same low 8-bits of their hashes). BUG=chromium:633497 Committed: https://crrev.com/b190d13331ba454a416e03c63804f1873252b24f Cr-Commit-Position: refs/heads/master@{#38675}

Patch Set 1 #

Patch Set 2 : Review comments #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -16 lines) Patch
M src/compiler/value-numbering-reducer.cc View 1 1 chunk +11 lines, -2 lines 0 comments Download
A + test/mjsunit/compiler/regress-633497.js View 1 chunk +16 lines, -14 lines 1 comment Download

Messages

Total messages: 22 (15 generated)
Jarin
Could you take a look, please?
4 years, 4 months ago (2016-08-16 21:17:06 UTC) #5
neis
lgtm. Awesome test!
4 years, 4 months ago (2016-08-17 08:29:27 UTC) #11
Jarin
On 2016/08/16 21:17:06, Jarin wrote: > Could you take a look, please? In an offline ...
4 years, 4 months ago (2016-08-17 08:30:16 UTC) #12
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/2251833002/20001
4 years, 4 months ago (2016-08-17 08:35:00 UTC) #16
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 4 months ago (2016-08-17 08:45:09 UTC) #18
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/b190d13331ba454a416e03c63804f1873252b24f Cr-Commit-Position: refs/heads/master@{#38675}
4 years, 4 months ago (2016-08-17 08:45:36 UTC) #20
ahaas
4 years, 4 months ago (2016-08-18 06:57:07 UTC) #22
Message was sent while issue was closed.
https://codereview.chromium.org/2251833002/diff/20001/test/mjsunit/compiler/r...
File test/mjsunit/compiler/regress-633497.js (right):

https://codereview.chromium.org/2251833002/diff/20001/test/mjsunit/compiler/r...
test/mjsunit/compiler/regress-633497.js:16: dummy = 527.5;
Could we add a comment which describes the purpose of these dummy values?

Powered by Google App Engine
This is Rietveld 408576698