• philhofer's avatar
    cmd/compile: emit OffPtr for first field in SSA'd structs · a6bd42f2
    philhofer authored
    Given
    
      (Store [c] (OffPtr <T1> [0] (Addr <T> _)) _
        (Store [c] (Addr <T> _) _ _))
    
    dead store elimination doesn't eliminate the inner
    Store, because it addresses a type of a different width
    than the first store.
    
    When decomposing StructMake operations, always generate
    an OffPtr to address struct fields so that dead stores to
    the first field of the struct can be optimized away.
    
    benchmarks affected on darwin/amd64:
    HTTPClientServer-8        73.2µs ± 1%    72.7µs ± 1%  -0.69%  (p=0.022 n=9+10)
    TimeParse-8                304ns ± 1%     300ns ± 0%  -1.61%  (p=0.000 n=9+9)
    RegexpMatchEasy1_32-8     80.1ns ± 0%    79.5ns ± 1%  -0.84%  (p=0.000 n=8+9)
    GobDecode-8               6.78ms ± 0%    6.81ms ± 1%  +0.46%  (p=0.000 n=9+10)
    Gunzip-8                  36.1ms ± 1%    36.2ms ± 0%  +0.37%  (p=0.019 n=10+10)
    JSONEncode-8              15.6ms ± 0%    15.7ms ± 0%  +0.69%  (p=0.000 n=9+10)
    
    Change-Id: Ia80d73fd047f9400c616ca64fdee4f438a0e7f21
    Reviewed-on: https://go-review.googlesource.com/37769
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    a6bd42f2
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...