• David Chase's avatar
    [dev.ssa] cmd/compile: enhance command line option processing for SSA · 378a8636
    David Chase authored
    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/19885Reviewed-by: default avatarKeith Randall <khr@golang.org>
    Reviewed-by: default avatarTodd Neal <todd@tneal.org>
    378a8636
config.go 6.61 KB