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

Issue 2466643002: AOT: Enable branch merging for checked smi comparisons (Closed)

Created:
4 years, 1 month ago by Florian Schneider
Modified:
4 years, 1 month ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

AOT: Enable branch merging for checked smi comparisons This generates better code for smi comparisons in AOT code where the inputs are not known smis: It avoids materializing the bool-value before branching. Before: ;; v46 <- CheckedSmiOp:86(==, v35, v77) ;; Branch if StrictCompare:88(!==, v46, v38) goto (8, 9) 0x10e0c2ca3 f6c201 testb rdx,1 0x10e0c2ca6 0f8526010000 jnz 0x10e0c2dd2 0x10e0c2cac 483bca cmpq rcx,rdx 0x10e0c2caf 0f8409000000 jz 0x10e0c2cbe 0x10e0c2cb5 498b5e58 movq rbx,[thr+0x58] false 0x10e0c2cb9 e904000000 jmp 0x10e0c2cc2 0x10e0c2cbe 498b5e50 movq rbx,[thr+0x50] true 0x10e0c2cc2 493b5e50 cmpq rbx,[thr+0x50] true 0x10e0c2cc6 0f8429000000 jz 0x10e0c2cf5 ;; B9 ;; B8 === After: ;; Branch if CheckedSmiComparison:86(!=, v35, v77) goto (8, 9) 0x118b3ce15 f6c201 testb rdx,1 0x118b3ce18 0f850c010000 jnz 0x118b3cf2a 0x118b3ce1e 483bca cmpq rcx,rdx 0x118b3ce21 0f8429000000 jz 0x118b3ce50 ;; B9 ;; B8 R=vegorov@google.com Committed: https://github.com/dart-lang/sdk/commit/0294f8650d5dab0b786f10fb180e32008a131aae BUG=#27459

Patch Set 1 #

Patch Set 2 : merged #

Patch Set 3 : ported to all architectures #

Total comments: 4

Patch Set 4 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+666 lines, -90 lines) Patch
M runtime/vm/aot_optimizer.cc View 1 chunk +15 lines, -1 line 0 comments Download
M runtime/vm/branch_optimizer.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/constant_propagator.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M runtime/vm/flow_graph.cc View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M runtime/vm/il_printer.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 1 2 3 4 chunks +50 lines, -2 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 2 8 chunks +34 lines, -15 lines 0 comments Download
M runtime/vm/intermediate_language_arm.cc View 1 2 1 chunk +126 lines, -12 lines 0 comments Download
M runtime/vm/intermediate_language_arm64.cc View 1 2 2 chunks +131 lines, -18 lines 0 comments Download
M runtime/vm/intermediate_language_ia32.cc View 1 2 1 chunk +29 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language_mips.cc View 1 2 2 chunks +129 lines, -18 lines 0 comments Download
M runtime/vm/intermediate_language_x64.cc View 1 2 3 chunks +130 lines, -23 lines 0 comments Download

Messages

Total messages: 8 (3 generated)
Florian Schneider
4 years, 1 month ago (2016-11-01 12:42:37 UTC) #2
Florian Schneider
Richards 4.6% speedup before: 2926 2871 2903 2919 2894 after: 2767 2752 2780 2768 2796
4 years, 1 month ago (2016-11-01 13:11:42 UTC) #3
Vyacheslav Egorov (Google)
LGTM though I have one question: have you looked at the code size? if we ...
4 years, 1 month ago (2016-11-01 13:19:07 UTC) #4
Florian Schneider
Size change is -20K on Richards. Note that this CL does not hoist branches through ...
4 years, 1 month ago (2016-11-01 15:26:25 UTC) #5
Florian Schneider
4 years, 1 month ago (2016-11-01 16:08:31 UTC) #7
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
0294f8650d5dab0b786f10fb180e32008a131aae (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698