• David Chase's avatar
    cmd/compile: assign and preserve statement boundaries. · c2c1822b
    David Chase authored
    A new pass run after ssa building (before any other
    optimization) identifies the "first" ssa node for each
    statement. Other "noise" nodes are tagged as being never
    appropriate for a statement boundary (e.g., VarKill, VarDef,
    Phi).
    
    Rewrite, deadcode, cse, and nilcheck are modified to move
    the statement boundaries forward whenever possible if a
    boundary-tagged ssa value is removed; never-boundary nodes
    are ignored in this search (some operations involving
    constants are also tagged as never-boundary and also ignored
    because they are likely to be moved or removed during
    optimization).
    
    Code generation treats all nodes except those explicitly
    marked as statement boundaries as "not statement" nodes,
    and floats statement boundaries to the beginning of each
    same-line run of instructions found within a basic block.
    
    Line number html conversion was modified to make statement
    boundary nodes a bit more obvious by prepending a "+".
    
    The code in fuse.go that glued together the value slices
    of two blocks produced a result that depended on the
    former capacities (not lengths) of the two slices.  This
    causes differences in the 386 bootstrap, and also can
    sometimes put values into an order that does a worse job
    of preserving statement boundaries when values are removed.
    
    Portions of two delve tests that had caught problems were
    incorporated into ssa/debug_test.go.  There are some
    opportunities to do better with optimized code, but the
    next-ing is not lying or overly jumpy.
    
    Over 4 CLs, compilebench geomean measured binary size
    increase of 3.5% and compile user time increase of 3.8%
    (this is after optimization to reuse a sparse map instead
    of creating multiple maps.)
    
    This CL worsens the optimized-debugging experience with
    Delve; we need to work with the delve team so that
    they can use the is_stmt marks that we're emitting now.
    
    The reference output changes from time to time depending
    on other changes in the compiler, sometimes better,
    sometimes worse.
    
    This CL now includes a test ensuring that 99+% of the lines
    in the Go command itself (a handy optimized binary) include
    is_stmt markers.
    
    Change-Id: I359c94e06843f1eb41f9da437bd614885aa9644a
    Reviewed-on: https://go-review.googlesource.com/102435
    Run-TryBot: David Chase <drchase@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarAustin Clements <austin@google.com>
    c2c1822b
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
plugin Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang_org/x Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
cmp.bash Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
naclmake.bash Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...