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

Issue 986073003: [TurboFan] Calculate precise ranges for bitwise-or with positive input ranges.

Created:
5 years, 9 months ago by dougc
Modified:
4 years, 9 months ago
Reviewers:
Benedikt Meurer, Jarin
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] Calculate precise ranges for bitwise-or with positive input ranges. The ranges computed for the bitwise-or operation, by the TurboFan typer, are currently very loose. Might as well compute the precise range, and this patch makes a start by doing so when the input ranges are positive. It also moves some simple and common special cases to the start. BUG=

Patch Set 1 #

Total comments: 1

Patch Set 2 : Comment the source code and add unit tests #

Patch Set 3 : Precise bitwise-or result type derivation for all int32_t input ranges. #

Patch Set 4 : Minor cleanup. #

Patch Set 5 : Address some of the feedback. #

Patch Set 6 : Split the bitwise-and result type derivation into a separate function. #

Patch Set 7 : Split the bitwise-or type derivation into a separate function. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -25 lines) Patch
M src/compiler/typer.h View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M src/compiler/typer.cc View 1 2 3 4 5 1 chunk +154 lines, -25 lines 0 comments Download
M test/unittests/compiler/typer-unittest.cc View 1 2 3 4 5 6 2 chunks +43 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (4 generated)
dougc
5 years, 9 months ago (2015-03-08 16:23:16 UTC) #2
Jarin
On 2015/03/08 16:23:16, dougc wrote: When writing the typer, we specifically wanted to keep it ...
5 years, 9 months ago (2015-03-09 13:29:07 UTC) #3
dougc
On 2015/03/09 13:29:07, jarin wrote: > On 2015/03/08 16:23:16, dougc wrote: > > When writing ...
5 years, 9 months ago (2015-03-10 06:52:24 UTC) #4
Benedikt Meurer
One thing I'd like to know: Do you plan to change Emscripten to generate this ...
5 years, 9 months ago (2015-03-10 07:43:14 UTC) #6
titzer
https://codereview.chromium.org/986073003/diff/1/src/compiler/typer.cc File src/compiler/typer.cc (right): https://codereview.chromium.org/986073003/diff/1/src/compiler/typer.cc#newcode877 src/compiler/typer.cc:877: Please add unit tests for the typer and mjsunit ...
5 years, 9 months ago (2015-03-10 07:47:13 UTC) #8
dougc
On 2015/03/10 07:43:14, Benedikt Meurer wrote: > One thing I'd like to know: Do you ...
5 years, 9 months ago (2015-03-12 13:14:24 UTC) #9
Benedikt Meurer
5 years, 9 months ago (2015-03-12 13:37:00 UTC) #10
On 2015/03/12 13:14:24, dougc wrote:
> On 2015/03/10 07:43:14, Benedikt Meurer wrote:
> > One thing I'd like to know: Do you plan to change Emscripten to generate
this
> > "index masking" based code? Or is it just for developers who write asm.js
code
> > by hand?
> 
> Emscripten has had an experimental 'POINTER_MASKING' feature for some time,
and
> an update is inbound, see: https://github.com/kripken/emscripten/pull/3240
> 
> It emits buffer accesses as a[(i&m)+c >> n] and V8 optimizes this well on the
> ia32 and with a patch well on x64 see issue 860283004. The masks are defined
> with a 'const' so the patch in issue 967093002 is also need for good
performance
> (Odin does not optimize a closure 'var' well).

That's great news! If this could be enabled by default for Emscripten, it'll
benefit both Firefox and Chrome immediately!
I'll look into the other patch again to see if we can make it work.

Powered by Google App Engine
This is Rietveld 408576698