Skip to content

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

Closed

Description

@dlespiau

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.

Activity

  1. gopherbot commented on May 12, 2017

    @gopherbot
    Contributor

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

  2. 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[/+] on May 13, 2017
  3. added this to the Go1.10 milestone on May 13, 2017
  4. bradfitz commented on May 13, 2017

    @bradfitz
    Contributor

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

  5. modified the milestones: Go1.9Maybe, Go1.10 on May 13, 2017
  6. josharian commented on May 14, 2017

    @josharian
    Contributor

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

  7. modified the milestones: Go1.10, Go1.9Maybe on Jul 24, 2017
  8. modified the milestones: Go1.10, Go1.11 on Nov 29, 2017
  9. gopherbot commented on Apr 29, 2018

    @gopherbot
    Contributor

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

  10. locked and limited conversation to collaborators on Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions