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

Issue 2004006: ARM: new patterns to optimize LDR, STR,PUSH/POP on different regs, with/without using REG COPY (Closed)

Created:
10 years, 7 months ago by subratokde
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Added implementation in Assembler::ldr() to recognize and optimize the following pattern sequences (tested v8 regression tests, mozilla, sputnik on Arm-Simulator & ARMv7 target) 1) Pattern: Ldr/str same fp+offset, same register Example: The following: str rx, [fp, #-12] ldr rx, [fp, #-12] Becomes: str rx, [fp, #-12] 2) Pattern.Ldr/str same fp+offset, different register Example: The following: str rx, [fp, #-12] ldr ry, [fp, #-12] Becomes: str rx, [fp, #-12] mov ry, rx 3) Pattern: push & pop from/to same register, with a fp+offset ldr in between Example: The following: str rx, [sp, #-4]! ldr rz, [fp, #-24] ldr rx, [sp], #+4 Becomes: 3.1 if(rx == rz) delete all instructions 3.2 if(rx != rz) just becomes: ldr rz, [fp, #-24] 4) Pattern: push & pop from/to different registers with a fp+offset ldr in between Example: The following: str rx, [sp, #-4]! ldr rz, [fp, #-24] ldr ry, [sp], #+4 Becomes: 4.1 if(ry == rz) just becomes: mov ry, rx; // since ldr rz is dead code. 4.2 if(rx != rz) just becomes: ldr rz, [fp, #-24] mov ry, rx 4.3 if((ry != rz) || (rx == rz)) just becomes: mov ry, rx ldr rz, [fp, #-24] This change now also integrates http://codereview.chromium.org/2001008/show, i.e., "optimize push/pop on diff reg as reg move", as both the changes share the same set of APIs. Example) the following: push rx pop ry Can be replaced as: mov ry, rx

Patch Set 1 #

Total comments: 18

Patch Set 2 : '' #

Total comments: 5

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+232 lines, -11 lines) Patch
M src/arm/assembler-arm.h View 2 1 chunk +7 lines, -0 lines 0 comments Download
M src/arm/assembler-arm.cc View 1 2 3 chunks +221 lines, -11 lines 0 comments Download
M src/flag-definitions.h View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Erik Corry
http://codereview.chromium.org/2004006/diff/1/2 File src/arm/assembler-arm.cc (right): http://codereview.chromium.org/2004006/diff/1/2#newcode1118 src/arm/assembler-arm.cc:1118: reloc_info_writer.last_pc() <= (pc_ - pattern_size)) { These two lines ...
10 years, 7 months ago (2010-05-11 08:13:55 UTC) #1
Erik Corry
http://codereview.chromium.org/2004006/diff/1/2 File src/arm/assembler-arm.cc (right): http://codereview.chromium.org/2004006/diff/1/2#newcode1143 src/arm/assembler-arm.cc:1143: } else if ((ldrInstr & 0x00000FFF) == (strInstr & ...
10 years, 7 months ago (2010-05-11 08:18:20 UTC) #2
subratokde
UPLOADED Patch2 that takes care of the review comments. I also merged the other related ...
10 years, 7 months ago (2010-05-13 21:05:25 UTC) #3
Erik Corry
http://codereview.chromium.org/2004006/diff/5001/6001 File src/arm/assembler-arm.cc (right): http://codereview.chromium.org/2004006/diff/5001/6001#newcode272 src/arm/assembler-arm.cc:272: const Instr kMovRdMask = 0x0000f000; This constant is named ...
10 years, 7 months ago (2010-05-15 16:08:19 UTC) #4
Erik Corry
Please update the description on this issue to match how the patch has developed.
10 years, 7 months ago (2010-05-15 16:18:12 UTC) #5
subratokde
DONE.
10 years, 7 months ago (2010-05-17 07:53:16 UTC) #6
subratokde
>> http://codereview.chromium.org/2004006/diff/5001/6003#newcode103 src/flag-definitions.h:103: DEFINE_bool(push_pop_elimination, true, Why do we still need this? I preferred to keep ...
10 years, 7 months ago (2010-05-17 07:58:53 UTC) #7
Erik Corry
10 years, 7 months ago (2010-05-17 11:20:28 UTC) #8
Committed in bleeding edge 4662 with followup changes in r4663

Powered by Google App Engine
This is Rietveld 408576698