• Ben Shi's avatar
    cmd/compile: optimize 386's load/store combination · 4b78fe57
    Ben Shi authored
    This CL adds more combinations of two consequtive MOVBload/MOVBstore
    to a unique MOVWload/MOVWstore.
    
    1. The size of the go executable decreases about 4KB, and the total
    size of pkg/linux_386 (excluding cmd/compile) decreases about 1.5KB.
    
    2. There is no regression in the go1 benchmark result, excluding noise.
    name                     old time/op    new time/op    delta
    BinaryTree17-4              3.28s ± 2%     3.29s ± 2%    ~     (p=0.151 n=40+40)
    Fannkuch11-4                3.52s ± 1%     3.51s ± 1%  -0.28%  (p=0.002 n=40+40)
    FmtFprintfEmpty-4          45.4ns ± 4%    45.0ns ± 4%  -0.89%  (p=0.019 n=40+40)
    FmtFprintfString-4         81.9ns ± 7%    81.3ns ± 1%    ~     (p=0.660 n=40+25)
    FmtFprintfInt-4            91.9ns ± 9%    91.4ns ± 9%    ~     (p=0.249 n=40+40)
    FmtFprintfIntInt-4          143ns ± 4%     143ns ± 4%    ~     (p=0.760 n=40+40)
    FmtFprintfPrefixedInt-4     184ns ± 3%     183ns ± 4%    ~     (p=0.485 n=40+40)
    FmtFprintfFloat-4           408ns ± 3%     409ns ± 3%    ~     (p=0.961 n=40+40)
    FmtManyArgs-4               597ns ± 4%     602ns ± 3%    ~     (p=0.413 n=40+40)
    GobDecode-4                7.13ms ± 6%    7.14ms ± 6%    ~     (p=0.859 n=40+40)
    GobEncode-4                6.86ms ± 9%    6.94ms ± 7%    ~     (p=0.162 n=40+40)
    Gzip-4                      395ms ± 4%     396ms ± 3%    ~     (p=0.099 n=40+40)
    Gunzip-4                   40.9ms ± 4%    41.1ms ± 3%    ~     (p=0.064 n=40+40)
    HTTPClientServer-4         63.6µs ± 2%    63.6µs ± 3%    ~     (p=0.832 n=36+39)
    JSONEncode-4               16.1ms ± 3%    15.8ms ± 3%  -1.60%  (p=0.001 n=40+40)
    JSONDecode-4               61.0ms ± 3%    61.5ms ± 4%    ~     (p=0.065 n=40+40)
    Mandelbrot200-4            5.16ms ± 3%    5.18ms ± 3%    ~     (p=0.056 n=40+40)
    GoParse-4                  3.25ms ± 2%    3.23ms ± 3%    ~     (p=0.727 n=40+40)
    RegexpMatchEasy0_32-4      90.2ns ± 3%    89.3ns ± 6%  -0.98%  (p=0.002 n=40+40)
    RegexpMatchEasy0_1K-4       812ns ± 3%     815ns ± 3%    ~     (p=0.309 n=40+40)
    RegexpMatchEasy1_32-4       103ns ± 6%     103ns ± 5%    ~     (p=0.680 n=40+40)
    RegexpMatchEasy1_1K-4      1.01µs ± 4%    1.02µs ± 3%    ~     (p=0.326 n=40+33)
    RegexpMatchMedium_32-4      120ns ± 4%     120ns ± 5%    ~     (p=0.834 n=40+40)
    RegexpMatchMedium_1K-4     40.1µs ± 3%    39.5µs ± 4%  -1.35%  (p=0.000 n=40+40)
    RegexpMatchHard_32-4       2.27µs ± 6%    2.23µs ± 4%  -1.67%  (p=0.011 n=40+40)
    RegexpMatchHard_1K-4       67.2µs ± 3%    67.2µs ± 3%    ~     (p=0.149 n=40+40)
    Revcomp-4                   1.84s ± 2%     1.86s ± 3%  +0.70%  (p=0.020 n=40+40)
    Template-4                 69.0ms ± 4%    69.8ms ± 3%  +1.20%  (p=0.003 n=40+40)
    TimeParse-4                 438ns ± 3%     439ns ± 4%    ~     (p=0.650 n=40+40)
    TimeFormat-4                412ns ± 3%     412ns ± 3%    ~     (p=0.888 n=40+40)
    [Geo mean]                 65.2µs         65.2µs       -0.04%
    
    name                     old speed      new speed      delta
    GobDecode-4               108MB/s ± 6%   108MB/s ± 6%    ~     (p=0.855 n=40+40)
    GobEncode-4               112MB/s ± 9%   111MB/s ± 8%    ~     (p=0.159 n=40+40)
    Gzip-4                   49.2MB/s ± 4%  49.1MB/s ± 3%    ~     (p=0.102 n=40+40)
    Gunzip-4                  474MB/s ± 3%   472MB/s ± 3%    ~     (p=0.063 n=40+40)
    JSONEncode-4              121MB/s ± 3%   123MB/s ± 3%  +1.62%  (p=0.001 n=40+40)
    JSONDecode-4             31.9MB/s ± 3%  31.6MB/s ± 4%    ~     (p=0.070 n=40+40)
    GoParse-4                17.9MB/s ± 2%  17.9MB/s ± 3%    ~     (p=0.696 n=40+40)
    RegexpMatchEasy0_32-4     355MB/s ± 3%   358MB/s ± 5%  +0.99%  (p=0.002 n=40+40)
    RegexpMatchEasy0_1K-4    1.26GB/s ± 3%  1.26GB/s ± 3%    ~     (p=0.381 n=40+40)
    RegexpMatchEasy1_32-4     310MB/s ± 5%   310MB/s ± 4%    ~     (p=0.655 n=40+40)
    RegexpMatchEasy1_1K-4    1.01GB/s ± 4%  1.01GB/s ± 3%    ~     (p=0.351 n=40+33)
    RegexpMatchMedium_32-4   8.32MB/s ± 4%  8.34MB/s ± 5%    ~     (p=0.696 n=40+40)
    RegexpMatchMedium_1K-4   25.6MB/s ± 3%  25.9MB/s ± 4%  +1.36%  (p=0.000 n=40+40)
    RegexpMatchHard_32-4     14.1MB/s ± 6%  14.3MB/s ± 4%  +1.64%  (p=0.011 n=40+40)
    RegexpMatchHard_1K-4     15.2MB/s ± 3%  15.2MB/s ± 3%    ~     (p=0.147 n=40+40)
    Revcomp-4                 138MB/s ± 2%   137MB/s ± 3%  -0.70%  (p=0.021 n=40+40)
    Template-4               28.1MB/s ± 4%  27.8MB/s ± 3%  -1.19%  (p=0.003 n=40+40)
    [Geo mean]               83.7MB/s       83.7MB/s       +0.03%
    
    Change-Id: I2a2b3a942b5c45467491515d201179fd192e65c9
    Reviewed-on: https://go-review.googlesource.com/c/141650
    Run-TryBot: Ben Shi <powerman1st@163.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    4b78fe57
Name
Last commit
Last update
..
gen Loading commit data...
testdata Loading commit data...
README.md Loading commit data...
TODO Loading commit data...
biasedsparsemap.go Loading commit data...
block.go Loading commit data...
branchelim.go Loading commit data...
branchelim_test.go Loading commit data...
cache.go Loading commit data...
check.go Loading commit data...
checkbce.go Loading commit data...
compile.go Loading commit data...
config.go Loading commit data...
copyelim.go Loading commit data...
copyelim_test.go Loading commit data...
critical.go Loading commit data...
cse.go Loading commit data...
cse_test.go Loading commit data...
deadcode.go Loading commit data...
deadcode_test.go Loading commit data...
deadstore.go Loading commit data...
deadstore_test.go Loading commit data...
debug.go Loading commit data...
debug_test.go Loading commit data...
decompose.go Loading commit data...
dom.go Loading commit data...
dom_test.go Loading commit data...
export_test.go Loading commit data...
flagalloc.go Loading commit data...
func.go Loading commit data...
func_test.go Loading commit data...
fuse.go Loading commit data...
fuse_test.go Loading commit data...
html.go Loading commit data...
id.go Loading commit data...
layout.go Loading commit data...
lca.go Loading commit data...
lca_test.go Loading commit data...
likelyadjust.go Loading commit data...
location.go Loading commit data...
loop_test.go Loading commit data...
loopbce.go Loading commit data...
loopreschedchecks.go Loading commit data...
looprotate.go Loading commit data...
lower.go Loading commit data...
magic.go Loading commit data...
magic_test.go Loading commit data...
nilcheck.go Loading commit data...
nilcheck_test.go Loading commit data...
numberlines.go Loading commit data...
op.go Loading commit data...
opGen.go Loading commit data...
opt.go Loading commit data...
passbm_test.go Loading commit data...
phielim.go Loading commit data...
phiopt.go Loading commit data...
poset.go Loading commit data...
poset_test.go Loading commit data...
print.go Loading commit data...
prove.go Loading commit data...
redblack32.go Loading commit data...
redblack32_test.go Loading commit data...
regalloc.go Loading commit data...
regalloc_test.go Loading commit data...
rewrite.go Loading commit data...
rewrite386.go Loading commit data...
rewriteAMD64.go Loading commit data...
rewriteARM.go Loading commit data...
rewriteARM64.go Loading commit data...
rewriteMIPS.go Loading commit data...
rewriteMIPS64.go Loading commit data...
rewritePPC64.go Loading commit data...
rewriteS390X.go Loading commit data...
rewriteWasm.go Loading commit data...
rewrite_test.go Loading commit data...
rewritedec.go Loading commit data...
rewritedec64.go Loading commit data...
rewritegeneric.go Loading commit data...
schedule.go Loading commit data...
schedule_test.go Loading commit data...
shift_test.go Loading commit data...
shortcircuit.go Loading commit data...
shortcircuit_test.go Loading commit data...
sizeof_test.go Loading commit data...
softfloat.go Loading commit data...
sparsemap.go Loading commit data...
sparseset.go Loading commit data...
sparsetree.go Loading commit data...
sparsetreemap.go Loading commit data...
stackalloc.go Loading commit data...
stackframe.go Loading commit data...
stmtlines_test.go Loading commit data...
tighten.go Loading commit data...
trim.go Loading commit data...
value.go Loading commit data...
writebarrier.go Loading commit data...
writebarrier_test.go Loading commit data...
zcse.go Loading commit data...
zeroextension_test.go Loading commit data...