]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: escape analysis explanations added to -m -m output
authorDavid Chase <drchase@google.com>
Mon, 29 Feb 2016 15:43:18 +0000 (10:43 -0500)
committerDavid Chase <drchase@google.com>
Thu, 17 Mar 2016 13:29:48 +0000 (13:29 +0000)
commit2d56dee61bf76328b3e4289f147076eb88c5582b
treee8ffe28841a750ae413c17ca4df104c37901c9e4
parent50bc546d432632ba948efd43927973ea752549ed
cmd/compile: escape analysis explanations added to -m -m output

This should probably be considered "experimental" at this stage, but
what it needs is feedback from adventurous adopters.  I think the data
structure used for describing escape reasons might be extendable to
allow a cleanup of the underlying algorithms, which suffers from
insufficiently separated concerns (the graph does not deal well with
escape level adjustments, so it is augmented by a second custom-walk
portion of the "flood" phase. It would be better to put it all,
including level adjustments, in a single graph structure, and then
simply flood the graph.

Tweaked to avoid allocations in the no-logging case.

Modified run.go to ignore lines with leading "#" in the output (since
it can never match a line), and in -update_errors to ignore leading
tabs in output lines and to normalize embedded filenames.

Currently requires -m -m because otherwise the noise/update
burden for the other escape tests is considerable.

There is a partial test.  Existing escape analysis tests seem to
cover all except the panic case and what looks like it might be
unreachable code in escape analysis.

Fixes #10526.

Change-Id: I2524fdec54facae48b00b2548e25d9e46fcaf832
Reviewed-on: https://go-review.googlesource.com/18041
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/ssa/compile.go
test/escape_because.go [new file with mode: 0644]
test/run.go