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

Comments

Projects
None yet
6 participants
@dlespiau
Copy link
Contributor

commented May 12, 2017

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

This comment has been minimized.

Copy link

commented May 12, 2017

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

This comment has been minimized.

Copy link
Member

commented May 13, 2017

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

This comment has been minimized.

Copy link
Contributor

commented May 14, 2017

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

@mdempsky mdempsky modified the milestones: Go1.10, Go1.11 Nov 29, 2017

@ALTree ALTree removed the release-blocker label Apr 26, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Apr 29, 2018

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

@gopherbot gopherbot closed this in 8a958bb Apr 29, 2018

@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.
You can’t perform that action at this time.