Commit Graph

33 Commits

Author SHA1 Message Date
Benedikt Meurer
d8cfbc633d [turbofan] Split pure nodes in the scheduler if beneficial.
If a (pure) node has two or more uses, but there exists a path from the
common dominator of these uses to end, which does not contain a use,
then we split the node such that no unnecessary computation takes place.
Note however, that this only applies if the node cannot be hoisted out
of a loop.

BUG=v8:3864
LOG=n
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/899433005

Cr-Commit-Position: refs/heads/master@{#26404}
2015-02-03 14:51:08 +00:00
titzer
11311c083a [turbofan] Fix OSR compilations of for-in.
R=mstarzinger@chromium.org
LOG=Y
BUG=

Review URL: https://codereview.chromium.org/890543002

Cr-Commit-Position: refs/heads/master@{#26333}
2015-01-29 17:40:23 +00:00
Benedikt Meurer
19418d76df [x64] Fix optimization for certain checked load/stores.
BUG=chromium:439743
LOG=y
TEST=mjsunit
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/733893008

Cr-Commit-Position: refs/heads/master@{#25731}
2014-12-10 07:49:12 +00:00
rodolph.perfetta
55614cfe69 [turbofan] Recognize rotate right.
Extended the rotate left detection code.

BUG=

Review URL: https://codereview.chromium.org/760523004

Cr-Commit-Position: refs/heads/master@{#25517}
2014-11-26 11:49:43 +00:00
Benedikt Meurer
560b0c4534 [arm] Fix recognition of VNEG.
TEST=mjsunit,unittests
R=svenpanne@chromium.org

Committed: 2aed882fe7

Review URL: https://codereview.chromium.org/762493006

Cr-Commit-Position: refs/heads/master@{#25515}
2014-11-26 11:18:58 +00:00
machenbach
86f6123ade Revert of [arm] Fix recognition of VNEG. (patchset #3 id:40001 of https://codereview.chromium.org/762493006/)
Reason for revert:
Breaks arm compilation.

Original issue's description:
> [arm] Fix recognition of VNEG.
>
> TEST=mjsunit,unittests
> R=svenpanne@chromium.org
>
> Committed: 2aed882fe7

TBR=svenpanne@chromium.org,bmeurer@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/751653004

Cr-Commit-Position: refs/heads/master@{#25514}
2014-11-26 11:07:23 +00:00
Benedikt Meurer
2aed882fe7 [arm] Fix recognition of VNEG.
TEST=mjsunit,unittests
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/762493006

Cr-Commit-Position: refs/heads/master@{#25513}
2014-11-26 10:46:37 +00:00
Rodolph Perfetta
481772acdd [turbofan] remove redundant '& 0x1F' for shifts.
JavaScript shifts perform an implicit '& 0x1F' on their right operand, this
patch removes it when the underlying architecture already does it.

BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/732103002

Cr-Commit-Position: refs/heads/master@{#25438}
2014-11-20 13:09:26 +00:00
Benedikt Meurer
1d4dfd9ac4 [turbofan] Push JSToNumber conversions into Phis.
This essentially performs the following transformation

  JSToNumber(phi(x1,...,xn,control):primitive)
    => phi(JSToNumber(x1),...,JSToNumber(xn),control):number

which is similar to what we already do for JSToBoolean.

TEST=mjsunit/asm
R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/732463003

Cr-Commit-Position: refs/heads/master@{#25390}
2014-11-18 11:34:21 +00:00
Benedikt Meurer
45ff9d53c5 [turbofan] Optimize remainder of integer division by unknown power of two.
Drive-by-Fix: minint % 0 was broken on ARM, but we didn't notice because
there was no test covering that case...

TEST=msjunit
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/727673002

Cr-Commit-Position: refs/heads/master@{#25347}
2014-11-14 08:21:18 +00:00
bmeurer@chromium.org
24d288cb8a Fix copyright headers.
R=machenbach@chromium.org

Review URL: https://codereview.chromium.org/720793002

Cr-Commit-Position: refs/heads/master@{#25295}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25295 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-12 13:29:57 +00:00
bmeurer@chromium.org
8977e3d5e4 [arm] Recognize SXTB, SXTH, UXTB and UXTH.
TEST=cctest,msjunit/asm,unittests
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/709123005

Cr-Commit-Position: refs/heads/master@{#25228}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25228 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-10 05:49:17 +00:00
bmeurer@chromium.org
881cece8de [turbofan] Transform x * -1.0 to -0.0 - x.
TEST=msjunit/asm,unittests
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/683753004

Cr-Commit-Position: refs/heads/master@{#25176}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25176 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-06 06:13:46 +00:00
bmeurer@chromium.org
3abe032b4c Add test cases based on the programs from the Embenchen benchmark suite.
TEST=mjsunit/asm/embenchen
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/704653004

Cr-Commit-Position: refs/heads/master@{#25135}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25135 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-05 09:11:20 +00:00
bmeurer@chromium.org
50ecc64539 [turbofan] Fix missing machine type for float32/float64 array accesses.
TEST=mjsunit/asm
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/703883002

Cr-Commit-Position: refs/heads/master@{#25128}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25128 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-05 08:15:47 +00:00
bmeurer@chromium.org
e6cfe350f8 [turbofan] Fix recognition of Uint32Div in simplified lowering.
TEST=mjsunit/asm
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/701813003

Cr-Commit-Position: refs/heads/master@{#25103}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25103 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-04 11:37:47 +00:00
bmeurer@chromium.org
498920f91c [turbofan] Also optimize unsigned division by constant.
TEST=cctest,mjsunit,unittests
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/697663003

Cr-Commit-Position: refs/heads/master@{#25061}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25061 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-11-03 10:05:46 +00:00
titzer@chromium.org
bd5c9834b6 Fix bug in optimization of Uint32LessThan.
R=jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/689883003

Cr-Commit-Position: refs/heads/master@{#25023}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25023 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-30 15:52:47 +00:00
sigurds@chromium.org
75ac43928b Add floor, ceil, round (truncate) instructions for ia32, x64 (if SSE4.1) and
add floor, ceil, round (truncate and away from zero) for arm64.

R=bmeurer@chromium.org, dcarney@chromium.org, mstarzinger@chromium.org, rodolph.perfetta@arm.com
TEST=test/mjsunit/asm/math-floor.js,test/mjsunit/asm/math-ceil.js,test/unittest/compiler/js-builtin-reducer-unittest.cc

Review URL: https://codereview.chromium.org/677433002

Cr-Commit-Position: refs/heads/master@{#25018}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@25018 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-30 14:16:15 +00:00
bmeurer@chromium.org
de088f207c [turbofan] Introduce new Select operator to improve bounds checking.
TEST=mjsunit,unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/691513002

Cr-Commit-Position: refs/heads/master@{#24980}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24980 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-29 14:17:14 +00:00
bmeurer@chromium.org
95095af57f [turbofan] Improve typed lowering for JSToBoolean.
- JSToBoolean(x:string) => BooleanNot(NumberEqual(x.length, #0))
- JSToBoolean(phi(x1,...,xn):primitive) => phi(JSToBoolean(x1),...,JSToBoolean(xn))

TEST=cctest,mjsunit/asm/do-while,mjsunit/boolean,unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/681223002

Cr-Commit-Position: refs/heads/master@{#24919}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24919 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-28 08:34:15 +00:00
bmeurer@chromium.org
d029d76120 [turbofan] Skip bounds checks for positive indices only.
TEST=unittests,mjsunit/asm/int32array-constant-key
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/647773004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24716 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-20 06:25:41 +00:00
titzer@chromium.org
e4c6f9488e Implement graph trimming in ControlReducer.
Trimming the graph consists of breaking links from nodes that are not reachable from end to nodes that are reachable from end. Such dead nodes show up in the use lists of the live nodes and though mostly harmless, just clutter up the graph. They also can limit instruction selection opportunities, so it is good to get rid of them.

This CL is one half of the ControlReducer functionality, the other half
being branch folding.

R=bmeurer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/661923002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24694 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-17 11:51:57 +00:00
bmeurer@chromium.org
a779150260 [turbofan] Eliminate typed array bounds checks if both key and length are constant.
TEST=mjsunit,unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/638853004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24685 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-17 09:35:45 +00:00
bmeurer@chromium.org
fe6656fbfe [arm] Prefer BIC over BFC.
BFC requires same register for input and output and causes introduction
of some unneccesary gap moves.

TEST=unittests,mjsunit
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/658283003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-17 07:07:54 +00:00
bmeurer@chromium.org
81877a6440 [turbofan] Optimize division/modulus by constant.
TEST=cctest,mjsunit,unittests
R=dcarney@chromium.org, svenpanne@chromium.org

Review URL: https://codereview.chromium.org/654833002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24595 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-14 11:57:06 +00:00
bmeurer@chromium.org
5c1f7b5aa1 [turbofan] Optimize Int32Mod by power-of-two.
TEST=mjsunit/asm/int32-tmod,unittests
R=dcarney@chromium.org

Review URL: https://codereview.chromium.org/649083005

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24554 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-13 11:09:32 +00:00
bmeurer@chromium.org
9b306893a3 [turbofan] Properly emit bounds checks for typed array element loads.
Also fix an awfull bug in simplified lowering.

TEST=cctest,mjsunit/asm
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/640603003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24463 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-08 11:16:45 +00:00
titzer@chromium.org
015f963e8f Lower NumberMultiply, NumberDivide, and NumberModulus to Int32Mul, Int32[U]Div, and Int32[U]Mod when possible in simplified-lowering.
R=mstarzinger@chromium.org
BUG=

Review URL: https://codereview.chromium.org/620553008

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24462 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-10-08 10:53:46 +00:00
mstarzinger@chromium.org
28e733e7d0 Extend JSBuiltinReducer to cover Math.abs as well.
R=titzer@chromium.org
TEST=compiler-unittests/JSBuiltinReducerTest.MathAbs

Review URL: https://codereview.chromium.org/605123004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24255 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-09-26 14:06:56 +00:00
bmeurer@chromium.org
7099d635ee [turbofan] Reduce shl with sar/shr and same shift amount to bit-and.
The shl(sar(x, K), K) is a common pattern with typed loads/stores in
asm.js.

TEST=compiler-unittests,mjsunit/asm/int32array-unaligned
R=jarin@chromium.org

Review URL: https://codereview.chromium.org/598083007

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24238 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-09-26 07:35:59 +00:00
mstarzinger@chromium.org
47ec735026 Slightly adapt Math.fround test.
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/606583002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24215 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-09-25 08:44:15 +00:00
mstarzinger@chromium.org
ea97f413ee Extend JSBuiltinReducer to cover Math.fround as well.
R=bmeurer@chromium.org
TEST=compiler-unittests/JSBuiltinReducerTest.MathFround

Review URL: https://codereview.chromium.org/594183004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24187 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-09-24 14:55:13 +00:00