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

Issue 1706763002: [turbofan] Emit memory operands for cmp and test on ia32 and x64 when it makes sense. (Closed)

Created:
4 years, 10 months ago by epertoso
Modified:
4 years, 10 months ago
Reviewers:
Benedikt Meurer
CC:
v8-reviews_googlegroups.com, v8-x87-ports_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Emit memory operands for cmp and test on ia32 and x64 when it makes sense. The InstructionSelector now associates an effect level to every node in a block. The effect level of a node is the number of non-eliminatable nodes encountered from the beginning of the block to the node itself. With this change, on ia32 and x64, a load from memory into a register can be replaced by a memory operand if all of the following conditions hold: 1. The only use of the load is in a 32 or 64 bit word comparison. 2. The user node and the load node belong to the same block. 3. The values of the operands have the same size (i.e., no need to zero-extend or sign-extend the result of the load). BUG= Committed: https://crrev.com/0e43ff5632d38cfb8b0ea0bc6955d6f252cb9ad8 Cr-Commit-Position: refs/heads/master@{#34187}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Update. #

Total comments: 5

Patch Set 3 : x64 update only #

Total comments: 1

Patch Set 4 : Add support for opcode 0x39 in the ia32 disassembler. #

Total comments: 4

Patch Set 5 : Update #

Patch Set 6 : Update #

Patch Set 7 : Update. #

Total comments: 2

Patch Set 8 : Update. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -59 lines) Patch
M src/compiler/ia32/code-generator-ia32.cc View 1 2 3 1 chunk +26 lines, -6 lines 0 comments Download
M src/compiler/ia32/instruction-selector-ia32.cc View 1 2 3 4 5 6 2 chunks +66 lines, -11 lines 0 comments Download
M src/compiler/instruction-selector.h View 1 2 3 chunks +7 lines, -0 lines 0 comments Download
M src/compiler/instruction-selector.cc View 1 2 3 4 5 6 7 4 chunks +27 lines, -2 lines 0 comments Download
M src/compiler/x64/code-generator-x64.cc View 2 chunks +30 lines, -4 lines 0 comments Download
M src/compiler/x64/instruction-selector-x64.cc View 1 2 3 4 5 6 2 chunks +68 lines, -11 lines 0 comments Download
M src/ia32/assembler-ia32.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/ia32/assembler-ia32.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/ia32/disasm-ia32.cc View 1 2 3 1 chunk +23 lines, -25 lines 0 comments Download

Messages

Total messages: 23 (8 generated)
epertoso
4 years, 10 months ago (2016-02-17 13:05:36 UTC) #2
Benedikt Meurer
https://codereview.chromium.org/1706763002/diff/1/src/compiler/ia32/code-generator-ia32.cc File src/compiler/ia32/code-generator-ia32.cc (right): https://codereview.chromium.org/1706763002/diff/1/src/compiler/ia32/code-generator-ia32.cc#newcode533 src/compiler/ia32/code-generator-ia32.cc:533: Operand memop = i.MemoryOperand(&index); Nit: Please use "operand" instead ...
4 years, 10 months ago (2016-02-18 05:02:53 UTC) #3
epertoso
PTAL. https://codereview.chromium.org/1706763002/diff/1/src/compiler/ia32/code-generator-ia32.cc File src/compiler/ia32/code-generator-ia32.cc (right): https://codereview.chromium.org/1706763002/diff/1/src/compiler/ia32/code-generator-ia32.cc#newcode533 src/compiler/ia32/code-generator-ia32.cc:533: Operand memop = i.MemoryOperand(&index); On 2016/02/18 at 05:02:53, ...
4 years, 10 months ago (2016-02-18 10:58:30 UTC) #4
Benedikt Meurer
https://codereview.chromium.org/1706763002/diff/20001/src/compiler/ia32/instruction-selector-ia32.cc File src/compiler/ia32/instruction-selector-ia32.cc (right): https://codereview.chromium.org/1706763002/diff/20001/src/compiler/ia32/instruction-selector-ia32.cc#newcode993 src/compiler/ia32/instruction-selector-ia32.cc:993: void VisitCompare(InstructionSelector* selector, InstructionCode opcode, Please add a new ...
4 years, 10 months ago (2016-02-18 11:44:39 UTC) #5
epertoso
As discussed, I made the changes only in instruction-selector-x64.cc and InstructionSelector::CanCover. Seems slightly more readable ...
4 years, 10 months ago (2016-02-18 13:17:14 UTC) #6
epertoso
https://codereview.chromium.org/1706763002/diff/40001/src/compiler/x64/instruction-selector-x64.cc File src/compiler/x64/instruction-selector-x64.cc (right): https://codereview.chromium.org/1706763002/diff/40001/src/compiler/x64/instruction-selector-x64.cc#newcode1345 src/compiler/x64/instruction-selector-x64.cc:1345: DCHECK(left_operands_count > 0 && left_operands_count <= 3); Already deleted ...
4 years, 10 months ago (2016-02-18 13:31:35 UTC) #7
Benedikt Meurer
This one looks way better. Let's do this for the start.
4 years, 10 months ago (2016-02-18 13:49:56 UTC) #8
epertoso
On 2016/02/18 at 13:49:56, bmeurer wrote: > This one looks way better. Let's do this ...
4 years, 10 months ago (2016-02-18 14:07:00 UTC) #10
Benedikt Meurer
Please provide a description of what the intent and behavioral changes are, and please prefix ...
4 years, 10 months ago (2016-02-19 08:34:47 UTC) #12
epertoso
https://codereview.chromium.org/1706763002/diff/100001/src/compiler/instruction-selector.cc File src/compiler/instruction-selector.cc (right): https://codereview.chromium.org/1706763002/diff/100001/src/compiler/instruction-selector.cc#newcode688 src/compiler/instruction-selector.cc:688: for (auto* node : *block) { On 2016/02/19 at ...
4 years, 10 months ago (2016-02-19 10:15:54 UTC) #15
Benedikt Meurer
LGTM once comment is addressed. https://codereview.chromium.org/1706763002/diff/180001/src/compiler/instruction-selector.cc File src/compiler/instruction-selector.cc (right): https://codereview.chromium.org/1706763002/diff/180001/src/compiler/instruction-selector.cc#newcode689 src/compiler/instruction-selector.cc:689: if (!node->op()->HasProperty(Operator::kEliminatable)) ++effect_level; Thinking ...
4 years, 10 months ago (2016-02-20 17:38:48 UTC) #16
epertoso
https://codereview.chromium.org/1706763002/diff/180001/src/compiler/instruction-selector.cc File src/compiler/instruction-selector.cc (right): https://codereview.chromium.org/1706763002/diff/180001/src/compiler/instruction-selector.cc#newcode689 src/compiler/instruction-selector.cc:689: if (!node->op()->HasProperty(Operator::kEliminatable)) ++effect_level; On 2016/02/20 at 17:38:47, Benedikt Meurer ...
4 years, 10 months ago (2016-02-22 09:17:07 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1706763002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1706763002/200001
4 years, 10 months ago (2016-02-22 09:17:23 UTC) #20
commit-bot: I haz the power
Committed patchset #8 (id:200001)
4 years, 10 months ago (2016-02-22 09:45:19 UTC) #21
commit-bot: I haz the power
4 years, 10 months ago (2016-02-22 09:46:32 UTC) #23
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/0e43ff5632d38cfb8b0ea0bc6955d6f252cb9ad8
Cr-Commit-Position: refs/heads/master@{#34187}

Powered by Google App Engine
This is Rietveld 408576698