]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: better XPos for rematerialized values and JMPs
authorDavid Chase <drchase@google.com>
Fri, 21 Jul 2017 16:00:38 +0000 (12:00 -0400)
committerDavid Chase <drchase@google.com>
Sat, 7 Oct 2017 22:12:36 +0000 (22:12 +0000)
commitca360c39924bc1a4658c14ff023c4628c11f13a3
tree946ff3072dd14a921eb7591dd563ec3c408137e7
parentda4d740fc84bfbbfe24956725f864fecdc89002d
cmd/compile: better XPos for rematerialized values and JMPs

This attempts to choose better values for values that are
rematerialized (uses the XPos of the consumer, not the
original) and for unconditional branches (uses the last
assigned XPos in the block).

The JMP branches seem to sometimes end up with a PC in the
destination block, I think because of register movement
or rematerialization that gets placed in predecessor blocks.
This may be acceptable because (eyeball-empirically) that is
often the line number of the target block, so the line number
flow is correct.

Added proper test, that checks both -N -l and regular compilation.
The test is also capable (for gdb, delve soon) of tracking
variable printing based on comments in the source code.

There's substantial room for improvement in debugger behavior.

Updates #21098.

Change-Id: I13abd48a39141583b85576a015f561065819afd0
Reviewed-on: https://go-review.googlesource.com/50610
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/debug_test.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/regalloc.go
src/cmd/compile/internal/ssa/testdata/hist-dbg.delve-nexts [new file with mode: 0644]
src/cmd/compile/internal/ssa/testdata/hist-dbg.gdb-nexts [new file with mode: 0644]
src/cmd/compile/internal/ssa/testdata/hist-opt.delve-nexts [new file with mode: 0644]
src/cmd/compile/internal/ssa/testdata/hist-opt.gdb-nexts [new file with mode: 0644]
src/cmd/compile/internal/ssa/testdata/hist.go [new file with mode: 0644]
src/cmd/compile/internal/ssa/value.go