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

Issue 1242303005: [turbofan]: Elide extra move when accessing stack or frame register (Closed)

Created:
5 years, 5 months ago by danno
Modified:
4 years, 11 months ago
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]: Elide extra move when accessing stack or frame register Before this CL, the kFramePointer and kStackPointer IR instructions in turbo fan moved the values of the frame and stack pointers into explicitly allocated temporary registers. With this change, the instruction selector and code generator now handle the stack and frame register specially, allowing them to be directly used by generated code without an intermediate move.

Patch Set 1 #

Patch Set 2 : Remove dead code #

Patch Set 3 : Fix arm64 #

Patch Set 4 : src/compiler/code-generator.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+246 lines, -190 lines) Patch
M src/arm/frames-arm.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/arm/interface-descriptors-arm.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/arm64/frames-arm64.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M src/arm64/interface-descriptors-arm64.cc View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M src/compiler/arm/code-generator-arm.cc View 1 2 3 8 chunks +16 lines, -15 lines 0 comments Download
M src/compiler/arm64/code-generator-arm64.cc View 1 2 3 6 chunks +15 lines, -14 lines 0 comments Download
M src/compiler/code-generator-impl.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/compiler/ia32/code-generator-ia32.cc View 1 2 3 10 chunks +15 lines, -15 lines 0 comments Download
M src/compiler/instruction.h View 1 2 3 4 chunks +39 lines, -1 line 0 comments Download
M src/compiler/instruction.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M src/compiler/instruction-selector-impl.h View 1 chunk +20 lines, -6 lines 0 comments Download
M src/compiler/mips/code-generator-mips.cc View 1 2 3 13 chunks +21 lines, -20 lines 0 comments Download
M src/compiler/mips64/code-generator-mips64.cc View 1 2 3 16 chunks +24 lines, -23 lines 0 comments Download
M src/compiler/register-allocator.cc View 3 chunks +10 lines, -2 lines 0 comments Download
M src/compiler/register-allocator-verifier.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/register-allocator-verifier.cc View 4 chunks +9 lines, -2 lines 0 comments Download
M src/compiler/x64/code-generator-x64.cc View 1 2 3 19 chunks +40 lines, -39 lines 0 comments Download
M src/compiler/x87/instruction-selector-x87.cc View 1 2 3 1 chunk +0 lines, -20 lines 0 comments Download
M src/frames.h View 2 chunks +4 lines, -1 line 0 comments Download
M src/ia32/frames-ia32.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/ia32/interface-descriptors-ia32.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/interface-descriptors.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/mips/frames-mips.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/mips/interface-descriptors-mips.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/mips64/frames-mips64.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/mips64/interface-descriptors-mips64.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/ppc/interface-descriptors-ppc.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/x64/frames-x64.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/x64/interface-descriptors-x64.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/x87/interface-descriptors-x87.cc View 1 1 chunk +0 lines, -3 lines 0 comments Download
M test/cctest/compiler/test-run-stubs.cc View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
danno
PTAL
5 years, 5 months ago (2015-07-22 08:46:07 UTC) #2
Jarin
lgtm. I am wondering whether the extra complexity is going to pay for itself. The ...
5 years, 5 months ago (2015-07-23 08:13:01 UTC) #3
Benedikt Meurer
NOT LGTM. This change is not correct, because the stack pointer is not constant across ...
5 years, 5 months ago (2015-07-24 06:02:46 UTC) #5
danno
5 years, 5 months ago (2015-07-24 06:45:34 UTC) #6
On 2015/07/24 at 06:02:46, bmeurer wrote:
> NOT LGTM. This change is not correct, because the stack pointer is not
constant across a function (at the instruction level). We currently have
explicit Push operations there, and we might have other things in the future.
Plus we are still not sure whether LoadStackPointer should also be effectful.
> 
> Personally I'd also consider this change bad wrt. product excellence strategy,
because it's a lot of complexity for no real benefit (I'd guess that even in the
hottest paths, this only gives you up to 5% if at all).

Fair enough. It was meant to flush out a discussion that Jaro and I had earlier
this week. I missed the incorrectness because of the Push, and I can understand
the argument about the complexity.

Powered by Google App Engine
This is Rietveld 408576698