]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: enhance command line option processing for SSA
authorDavid Chase <drchase@google.com>
Thu, 25 Feb 2016 18:10:51 +0000 (13:10 -0500)
committerDavid Chase <drchase@google.com>
Thu, 25 Feb 2016 20:32:15 +0000 (20:32 +0000)
commit378a86368279ffdfecc50e91c4bcb61e72957d21
treeb6ca63a999ca01bfd77dcbafb332a85c474a9c37
parentfb54e0305fe209dd7ef36b901d28e7ee9b649442
[dev.ssa] cmd/compile: enhance command line option processing for SSA

The -d compiler flag can also specify ssa phase and flag,
for example -d=ssa/generic_cse/time,ssa/generic_cse/stats

Spaces in the phase names can be specified with an
underscore.  Flags currently parsed (not necessarily
recognized by the phases yet) are:

   on, off, mem, time, debug, stats, and test

On, off and time are handled in the harness,
debug, stats, and test are interpreted by the phase itself.

The pass is now attached to the Func being compiled, and a
new method logStats(key, ...value) on *Func to encourage a
semi-standardized format for that output.  Output fields
are separated by tabs to ease digestion by awk and
spreadsheets.  For example,
if f.pass.stats > 0 {
f.logStat("CSE REWRITES", rewrites)
}

Change-Id: I16db2b5af64c50ca9a47efeb51d961147a903abc
Reviewed-on: https://go-review.googlesource.com/19885
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Todd Neal <todd@tneal.org>
src/cmd/compile/internal/gc/lex.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/config.go
src/cmd/compile/internal/ssa/cse.go
src/cmd/compile/internal/ssa/func.go
src/cmd/compile/internal/ssa/func_test.go