Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: improve the help message of go tool compile -d ssa/help #20349

Closed
dlespiau opened this issue May 12, 2017 · 4 comments
Closed

cmd/compile: improve the help message of go tool compile -d ssa/help #20349

dlespiau opened this issue May 12, 2017 · 4 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dlespiau
Copy link
Contributor

I noticed it was somewhat difficult to read the ssa/help output:

  $ go tool compile -d ssa/help
  compile: GcFlag -d=ssa/<phase>/<flag>[=<value>]|[:<function_name>]
  <phase> is one of:
  check, all, build, intrinsics, early_phielim, early_copyelim
  early_deadcode, short_circuit, decompose_user, opt, zero_arg_cse
  opt_deadcode, generic_cse, phiopt, nilcheckelim, prove, loopbce
  decompose_builtin, dec, late_opt, generic_deadcode, check_bce
  writebarrier, fuse, dse, insert_resched_checks, tighten, lower
  lowered_cse, lowered_deadcode, checkLower, late_phielim, late_copyelim
  phi_tighten, late_deadcode, critical, likelyadjust, layout, schedule
  late_nilcheck, flagalloc, regalloc, stackframe, trim
  <flag> is one of on, off, debug, mem, time, test, stats, dump
  <value> defaults to 1
  <function_name> is required for "dump", specifies name of function to dump after <phase>
  Except for dump, output is directed to standard out; dump appears in a file.
  Phase "all" supports flags "time", "mem", and "dump".
  Phases "intrinsics" supports flags "on", "off", and "debug".
  Interpretation of the "debug" value depends on the phase.
  Dump files are named <phase>__<function_name>_<seq>.dump.

With a few tweaks here and there it looks more pleasing to the eye:

  $ go tool compile -d ssa/help
  compile: usage: -d=ssa/<phase>/<flag>[=<value>|<function_name>]

  <phase> is one of:

  	check, all, build, intrinsics, early_phielim, early_copyelim, early_deadcode
  	short_circuit, decompose_user, opt, zero_arg_cse, opt_deadcode, generic_cse
  	phiopt, nilcheckelim, prove, loopbce, decompose_builtin, dec, late_opt
  	generic_deadcode, check_bce, writebarrier, fuse, dse, insert_resched_checks
  	tighten, lower, lowered_cse, lowered_deadcode, checkLower, late_phielim
  	late_copyelim, phi_tighten, late_deadcode, critical, likelyadjust, layout
  	schedule, late_nilcheck, flagalloc, regalloc, stackframe, trim

  <flag> is one of on, off, debug, mem, time, test, stats, dump.
  Phase all supports flags time, mem, and dump.
  Phase intrinsics supports flags on, off, and debug.

  <value> defaults to 1.

  <function_name> is required for dump, specifies name of function to dump after <phase>.

  Except for dump, output is directed to standard out; dump appears in a file.
  Dump files are named <phase>__<function_name>_<seq>.dump.
@gopherbot
Copy link

CL https://golang.org/cl/41470 mentions this issue.

@bradfitz bradfitz changed the title Improve the help message of go tool compile -d ssa/help cmd/compile: improve the help message of go tool compile -d ssa/help May 13, 2017
@bradfitz bradfitz added this to the Go1.10 milestone May 13, 2017
@bradfitz
Copy link
Contributor

I consider this documentation and fine for Go 1.9 if you can find a reviewer. Probably @randall77 or @josharian.

@bradfitz bradfitz modified the milestones: Go1.9Maybe, Go1.10 May 13, 2017
@josharian
Copy link
Contributor

I'll review. Please consider adding a few examples of commonly used flags.

@bradfitz bradfitz modified the milestones: Go1.10, Go1.9Maybe Jul 24, 2017
@bradfitz bradfitz added NeedsFix The path to resolution is known, but the work has not been done. release-blocker labels Jul 24, 2017
@mdempsky mdempsky modified the milestones: Go1.10, Go1.11 Nov 29, 2017
@gopherbot
Copy link

Change https://golang.org/cl/110062 mentions this issue: cmd/compile: better formatting for ssa phases options doc

@golang golang locked and limited conversation to collaborators Apr 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

6 participants