README 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ./autogen.sh
  2. ./configure
  3. make
  4. cd src
  5. ./gcctree2gml gcc-tree-data-file output
  6. Then use a gmlviewer as gml4gtk or other.
  7. to generate data with gcc:
  8. gcc test.c -fdump-tree-all-graph
  9. https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
  10. -fdump-tree-switch
  11. -fdump-tree-switch-options
  12. -fdump-tree-switch-options=filename
  13. Control the dumping at various stages of processing the intermediate language tree to a file. The file name is generated by appending a switch-specific suffix to the source file name, and the file is created in the same directory as the output file. In case of =filename option, the dump is output on the given file instead of the auto named dump files. If the ‘-options’ form is used, options is a list of ‘-’ separated options which control the details of the dump. Not all options are applicable to all dumps; those that are not meaningful are ignored. The following options are available
  14. ‘address’
  15. Print the address of each node. Usually this is not meaningful as it changes according to the environment and source file. Its primary use is for tying up a dump file with a debug environment.
  16. ‘asmname’
  17. If DECL_ASSEMBLER_NAME has been set for a given decl, use that in the dump instead of DECL_NAME. Its primary use is ease of use working backward from mangled names in the assembly file.
  18. ‘slim’
  19. When dumping front-end intermediate representations, inhibit dumping of members of a scope or body of a function merely because that scope has been reached. Only dump such items when they are directly reachable by some other path.
  20. When dumping pretty-printed trees, this option inhibits dumping the bodies of control structures.
  21. When dumping RTL, print the RTL in slim (condensed) form instead of the default LISP-like representation.
  22. ‘raw’
  23. Print a raw representation of the tree. By default, trees are pretty-printed into a C-like representation.
  24. ‘details’
  25. Enable more detailed dumps (not honored by every dump option). Also include information from the optimization passes.
  26. ‘stats’
  27. Enable dumping various statistics about the pass (not honored by every dump option).
  28. ‘blocks’
  29. Enable showing basic block boundaries (disabled in raw dumps).
  30. ‘graph’
  31. For each of the other indicated dump files (-fdump-rtl-pass), dump a representation of the control flow graph suitable for viewing with GraphViz to file.passid.pass.dot. Each function in the file is pretty-printed as a subgraph, so that GraphViz can render them all in a single plot.
  32. This option currently only works for RTL dumps, and the RTL is always dumped in slim form.
  33. ‘vops’
  34. Enable showing virtual operands for every statement.
  35. ‘lineno’
  36. Enable showing line numbers for statements.
  37. ‘uid’
  38. Enable showing the unique ID (DECL_UID) for each variable.
  39. ‘verbose’
  40. Enable showing the tree dump for each statement.
  41. ‘eh’
  42. Enable showing the EH region number holding each statement.
  43. ‘scev’
  44. Enable showing scalar evolution analysis details.
  45. ‘optimized’
  46. Enable showing optimization information (only available in certain passes).
  47. ‘missed’
  48. Enable showing missed optimization information (only available in certain passes).
  49. ‘note’
  50. Enable other detailed optimization information (only available in certain passes).
  51. ‘=filename’
  52. Instead of an auto named dump file, output into the given file name. The file names stdout and stderr are treated specially and are considered already open standard streams. For example,
  53. gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
  54. -fdump-tree-pre=stderr file.c
  55. outputs vectorizer dump into foo.dump, while the PRE dump is output on to stderr. If two conflicting dump filenames are given for the same pass, then the latter option overrides the earlier one.
  56. ‘all’
  57. Turn on all options, except raw, slim, verbose and lineno.
  58. ‘optall’
  59. Turn on all optimization options, i.e., optimized, missed, and note.
  60. The following tree dumps are possible:
  61. ‘original’
  62. Dump before any tree based optimization, to file.original.
  63. ‘optimized’
  64. Dump after all tree based optimization, to file.optimized.
  65. ‘gimple’
  66. Dump each function before and after the gimplification pass to a file. The file name is made by appending .gimple to the source file name.
  67. ‘cfg’
  68. Dump the control flow graph of each function to a file. The file name is made by appending .cfg to the source file name.
  69. ‘ch’
  70. Dump each function after copying loop headers. The file name is made by appending .ch to the source file name.
  71. ‘ssa’
  72. Dump SSA related information to a file. The file name is made by appending .ssa to the source file name.
  73. ‘alias’
  74. Dump aliasing information for each function. The file name is made by appending .alias to the source file name.
  75. ‘ccp’
  76. Dump each function after CCP. The file name is made by appending .ccp to the source file name.
  77. ‘storeccp’
  78. Dump each function after STORE-CCP. The file name is made by appending .storeccp to the source file name.
  79. ‘pre’
  80. Dump trees after partial redundancy elimination. The file name is made by appending .pre to the source file name.
  81. ‘fre’
  82. Dump trees after full redundancy elimination. The file name is made by appending .fre to the source file name.
  83. ‘copyprop’
  84. Dump trees after copy propagation. The file name is made by appending .copyprop to the source file name.
  85. ‘store_copyprop’
  86. Dump trees after store copy-propagation. The file name is made by appending .store_copyprop to the source file name.
  87. ‘dce’
  88. Dump each function after dead code elimination. The file name is made by appending .dce to the source file name.
  89. ‘sra’
  90. Dump each function after performing scalar replacement of aggregates. The file name is made by appending .sra to the source file name.
  91. ‘sink’
  92. Dump each function after performing code sinking. The file name is made by appending .sink to the source file name.
  93. ‘dom’
  94. Dump each function after applying dominator tree optimizations. The file name is made by appending .dom to the source file name.
  95. ‘dse’
  96. Dump each function after applying dead store elimination. The file name is made by appending .dse to the source file name.
  97. ‘phiopt’
  98. Dump each function after optimizing PHI nodes into straightline code. The file name is made by appending .phiopt to the source file name.
  99. ‘forwprop’
  100. Dump each function after forward propagating single use variables. The file name is made by appending .forwprop to the source file name.
  101. ‘copyrename’
  102. Dump each function after applying the copy rename optimization. The file name is made by appending .copyrename to the source file name.
  103. ‘nrv’
  104. Dump each function after applying the named return value optimization on generic trees. The file name is made by appending .nrv to the source file name.
  105. ‘vect’
  106. Dump each function after applying vectorization of loops. The file name is made by appending .vect to the source file name.
  107. ‘slp’
  108. Dump each function after applying vectorization of basic blocks. The file name is made by appending .slp to the source file name.
  109. ‘vrp’
  110. Dump each function after Value Range Propagation (VRP). The file name is made by appending .vrp to the source file name.
  111. ‘all’
  112. Enable all the available tree dumps with the flags provided in this option.
  113. Mingjie Xing mingjie.xing@gmail.com