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

Issue 1580233003: [turbofan] avoid xchg instruction on Intel (Closed)

Created:
4 years, 11 months ago by Mircea Trofin
Modified:
4 years, 11 months ago
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] avoid xchg instruction on Intel On Intel, xchg stalls the pipeline. We use xchg to implement swap moves. In a separate exploration, the presence of xchg in a very hot loop, due to a change in register allocation, lead to over 20% regression. Simply changing that instruction with push/mov/pop (almost) eliminated the regression. In light of that, I removed uses of xchg. This leads to more instructions, though. That is particularly problematic for long cycles, which, today, we translate to successions of swaps. I plan to address this cycle issue in a separate change. For now, the goal is to unblock the initial work that lead here. Committed: https://crrev.com/7440edae1da2b78a37e6fe3a558e249dc33444aa Cr-Commit-Position: refs/heads/master@{#33282}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -10 lines) Patch
M src/compiler/ia32/code-generator-ia32.cc View 1 2 3 4 5 1 chunk +11 lines, -2 lines 1 comment Download
M src/compiler/x64/code-generator-x64.cc View 1 2 3 4 5 2 chunks +18 lines, -4 lines 0 comments Download
M src/crankshaft/ia32/lithium-gap-resolver-ia32.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/crankshaft/x64/lithium-gap-resolver-x64.cc View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 19 (7 generated)
Mircea Trofin
4 years, 11 months ago (2016-01-14 04:51:13 UTC) #3
Benedikt Meurer
lgtm
4 years, 11 months ago (2016-01-14 04:53:58 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1580233003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1580233003/100001
4 years, 11 months ago (2016-01-14 04:54:27 UTC) #7
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 11 months ago (2016-01-14 05:13:57 UTC) #9
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/7440edae1da2b78a37e6fe3a558e249dc33444aa Cr-Commit-Position: refs/heads/master@{#33282}
4 years, 11 months ago (2016-01-14 05:14:55 UTC) #11
Weiliang
On 2016/01/14 05:14:55, commit-bot: I haz the power wrote: > Patchset 6 (id:??) landed as ...
4 years, 11 months ago (2016-01-15 03:18:40 UTC) #12
Mircea Trofin
On 2016/01/15 03:18:40, Weiliang wrote: > On 2016/01/14 05:14:55, commit-bot: I haz the power wrote: ...
4 years, 11 months ago (2016-01-15 18:09:38 UTC) #13
Mircea Trofin
On 2016/01/15 18:09:38, Mircea Trofin wrote: > On 2016/01/15 03:18:40, Weiliang wrote: > > On ...
4 years, 11 months ago (2016-01-15 18:11:23 UTC) #14
Mircea Trofin
On 2016/01/15 18:11:23, Mircea Trofin wrote: > On 2016/01/15 18:09:38, Mircea Trofin wrote: > > ...
4 years, 11 months ago (2016-01-15 21:20:59 UTC) #15
yosin_UTC9
https://codereview.chromium.org/1580233003/diff/100001/src/compiler/ia32/code-generator-ia32.cc File src/compiler/ia32/code-generator-ia32.cc (right): https://codereview.chromium.org/1580233003/diff/100001/src/compiler/ia32/code-generator-ia32.cc#newcode1619 src/compiler/ia32/code-generator-ia32.cc:1619: __ push(src); Just a curiosity, why don't you use ...
4 years, 11 months ago (2016-01-20 01:48:18 UTC) #17
Mircea Trofin
On 2016/01/20 01:48:18, Yosi_UTC9 wrote: > https://codereview.chromium.org/1580233003/diff/100001/src/compiler/ia32/code-generator-ia32.cc > File src/compiler/ia32/code-generator-ia32.cc (right): > > https://codereview.chromium.org/1580233003/diff/100001/src/compiler/ia32/code-generator-ia32.cc#newcode1619 > ...
4 years, 11 months ago (2016-01-20 01:50:45 UTC) #18
yosin_UTC9
4 years, 11 months ago (2016-01-20 02:06:31 UTC) #19
Message was sent while issue was closed.
On 2016/01/20 at 01:50:45, mtrofin wrote:
> On 2016/01/20 01:48:18, Yosi_UTC9 wrote:
> >
https://codereview.chromium.org/1580233003/diff/100001/src/compiler/ia32/code...
> > File src/compiler/ia32/code-generator-ia32.cc (right):
> > 
> >
https://codereview.chromium.org/1580233003/diff/100001/src/compiler/ia32/code...
> > src/compiler/ia32/code-generator-ia32.cc:1619: __ push(src);
> > Just a curiosity, why don't you use XOR-technique for swapping registers? Is
> > PUSH/POP faster than three-XOR?
> 
> Yes, see the notes above. 
> 
> You can experiment with the choices by applying locally the patch (copied from
above)
> https://codereview.chromium.org/1596593002

Thanks for quick response!
Intel does amazing job. ;-)

Powered by Google App Engine
This is Rietveld 408576698