• Keith Randall's avatar
    cmd/compile: don't write back unchanged slice results · d4663e13
    Keith Randall authored
    Don't write back parts of a slicing operation if they
    are unchanged from the source of the slice.  For example:
    
    x.s = x.s[0:5]         // don't write back pointer or cap
    x.s = x.s[:5]          // don't write back pointer or cap
    x.s = x.s[:5:7]        // don't write back pointer
    
    There is more to be done here, for example:
    
    x.s = x.s[:len(x.s):7] // don't write back ptr or len
    
    This CL can't handle that one yet.
    
    Fixes #14855
    
    Change-Id: Id1e1a4fa7f3076dc1a76924a7f1cd791b81909bb
    Reviewed-on: https://go-review.googlesource.com/20954Reviewed-by: 's avatarAustin Clements <austin@google.com>
    Run-TryBot: Keith Randall <khr@golang.org>
    d4663e13
Name
Last commit
Last update
..
gen Loading commit data...
addressed_ssa.go Loading commit data...
append_ssa.go Loading commit data...
arithBoundary_ssa.go Loading commit data...
arithConst_ssa.go Loading commit data...
arith_ssa.go Loading commit data...
array_ssa.go Loading commit data...
assert_ssa.go Loading commit data...
break_ssa.go Loading commit data...
chan_ssa.go Loading commit data...
closure_ssa.go Loading commit data...
cmp_ssa.go Loading commit data...
compound_ssa.go Loading commit data...
copy_ssa.go Loading commit data...
ctl_ssa.go Loading commit data...
deferNoReturn_ssa.go Loading commit data...
fp_ssa.go Loading commit data...
loadstore_ssa.go Loading commit data...
map_ssa.go Loading commit data...
phi_ssa.go Loading commit data...
regalloc_ssa.go Loading commit data...
short_ssa.go Loading commit data...
slice.go Loading commit data...
string_ssa.go Loading commit data...
unsafe_ssa.go Loading commit data...
zero_ssa.go Loading commit data...