llvm-bcanalyzer.rst 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. llvm-bcanalyzer - LLVM bitcode analyzer
  2. =======================================
  3. .. program:: llvm-bcanalyzer
  4. SYNOPSIS
  5. --------
  6. :program:`llvm-bcanalyzer` [*options*] [*filename*]
  7. DESCRIPTION
  8. -----------
  9. The :program:`llvm-bcanalyzer` command is a small utility for analyzing bitcode
  10. files. The tool reads a bitcode file (such as generated with the
  11. :program:`llvm-as` tool) and produces a statistical report on the contents of
  12. the bitcode file. The tool can also dump a low level but human readable
  13. version of the bitcode file. This tool is probably not of much interest or
  14. utility except for those working directly with the bitcode file format. Most
  15. LLVM users can just ignore this tool.
  16. If *filename* is omitted or is ``-``, then :program:`llvm-bcanalyzer` reads its
  17. input from standard input. This is useful for combining the tool into a
  18. pipeline. Output is written to the standard output.
  19. OPTIONS
  20. -------
  21. .. program:: llvm-bcanalyzer
  22. .. option:: -nodetails
  23. Causes :program:`llvm-bcanalyzer` to abbreviate its output by writing out only
  24. a module level summary. The details for individual functions are not
  25. displayed.
  26. .. option:: -dump
  27. Causes :program:`llvm-bcanalyzer` to dump the bitcode in a human readable
  28. format. This format is significantly different from LLVM assembly and
  29. provides details about the encoding of the bitcode file.
  30. .. option:: -verify
  31. Causes :program:`llvm-bcanalyzer` to verify the module produced by reading the
  32. bitcode. This ensures that the statistics generated are based on a consistent
  33. module.
  34. .. option:: -help
  35. Print a summary of command line options.
  36. EXIT STATUS
  37. -----------
  38. If :program:`llvm-bcanalyzer` succeeds, it will exit with 0. Otherwise, if an
  39. error occurs, it will exit with a non-zero value, usually 1.
  40. SUMMARY OUTPUT DEFINITIONS
  41. --------------------------
  42. The following items are always printed by llvm-bcanalyzer. They comprize the
  43. summary output.
  44. **Bitcode Analysis Of Module**
  45. This just provides the name of the module for which bitcode analysis is being
  46. generated.
  47. **Bitcode Version Number**
  48. The bitcode version (not LLVM version) of the file read by the analyzer.
  49. **File Size**
  50. The size, in bytes, of the entire bitcode file.
  51. **Module Bytes**
  52. The size, in bytes, of the module block. Percentage is relative to File Size.
  53. **Function Bytes**
  54. The size, in bytes, of all the function blocks. Percentage is relative to File
  55. Size.
  56. **Global Types Bytes**
  57. The size, in bytes, of the Global Types Pool. Percentage is relative to File
  58. Size. This is the size of the definitions of all types in the bitcode file.
  59. **Constant Pool Bytes**
  60. The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
  61. Size.
  62. **Module Globals Bytes**
  63. Ths size, in bytes, of the Global Variable Definitions and their initializers.
  64. Percentage is relative to File Size.
  65. **Instruction List Bytes**
  66. The size, in bytes, of all the instruction lists in all the functions.
  67. Percentage is relative to File Size. Note that this value is also included in
  68. the Function Bytes.
  69. **Compaction Table Bytes**
  70. The size, in bytes, of all the compaction tables in all the functions.
  71. Percentage is relative to File Size. Note that this value is also included in
  72. the Function Bytes.
  73. **Symbol Table Bytes**
  74. The size, in bytes, of all the symbol tables in all the functions. Percentage is
  75. relative to File Size. Note that this value is also included in the Function
  76. Bytes.
  77. **Dependent Libraries Bytes**
  78. The size, in bytes, of the list of dependent libraries in the module. Percentage
  79. is relative to File Size. Note that this value is also included in the Module
  80. Global Bytes.
  81. **Number Of Bitcode Blocks**
  82. The total number of blocks of any kind in the bitcode file.
  83. **Number Of Functions**
  84. The total number of function definitions in the bitcode file.
  85. **Number Of Types**
  86. The total number of types defined in the Global Types Pool.
  87. **Number Of Constants**
  88. The total number of constants (of any type) defined in the Constant Pool.
  89. **Number Of Basic Blocks**
  90. The total number of basic blocks defined in all functions in the bitcode file.
  91. **Number Of Instructions**
  92. The total number of instructions defined in all functions in the bitcode file.
  93. **Number Of Long Instructions**
  94. The total number of long instructions defined in all functions in the bitcode
  95. file. Long instructions are those taking greater than 4 bytes. Typically long
  96. instructions are GetElementPtr with several indices, PHI nodes, and calls to
  97. functions with large numbers of arguments.
  98. **Number Of Operands**
  99. The total number of operands used in all instructions in the bitcode file.
  100. **Number Of Compaction Tables**
  101. The total number of compaction tables in all functions in the bitcode file.
  102. **Number Of Symbol Tables**
  103. The total number of symbol tables in all functions in the bitcode file.
  104. **Number Of Dependent Libs**
  105. The total number of dependent libraries found in the bitcode file.
  106. **Total Instruction Size**
  107. The total size of the instructions in all functions in the bitcode file.
  108. **Average Instruction Size**
  109. The average number of bytes per instruction across all functions in the bitcode
  110. file. This value is computed by dividing Total Instruction Size by Number Of
  111. Instructions.
  112. **Maximum Type Slot Number**
  113. The maximum value used for a type's slot number. Larger slot number values take
  114. more bytes to encode.
  115. **Maximum Value Slot Number**
  116. The maximum value used for a value's slot number. Larger slot number values take
  117. more bytes to encode.
  118. **Bytes Per Value**
  119. The average size of a Value definition (of any type). This is computed by
  120. dividing File Size by the total number of values of any type.
  121. **Bytes Per Global**
  122. The average size of a global definition (constants and global variables).
  123. **Bytes Per Function**
  124. The average number of bytes per function definition. This is computed by
  125. dividing Function Bytes by Number Of Functions.
  126. **# of VBR 32-bit Integers**
  127. The total number of 32-bit integers encoded using the Variable Bit Rate
  128. encoding scheme.
  129. **# of VBR 64-bit Integers**
  130. The total number of 64-bit integers encoded using the Variable Bit Rate encoding
  131. scheme.
  132. **# of VBR Compressed Bytes**
  133. The total number of bytes consumed by the 32-bit and 64-bit integers that use
  134. the Variable Bit Rate encoding scheme.
  135. **# of VBR Expanded Bytes**
  136. The total number of bytes that would have been consumed by the 32-bit and 64-bit
  137. integers had they not been compressed with the Variable Bit Rage encoding
  138. scheme.
  139. **Bytes Saved With VBR**
  140. The total number of bytes saved by using the Variable Bit Rate encoding scheme.
  141. The percentage is relative to # of VBR Expanded Bytes.
  142. DETAILED OUTPUT DEFINITIONS
  143. ---------------------------
  144. The following definitions occur only if the -nodetails option was not given.
  145. The detailed output provides additional information on a per-function basis.
  146. **Type**
  147. The type signature of the function.
  148. **Byte Size**
  149. The total number of bytes in the function's block.
  150. **Basic Blocks**
  151. The number of basic blocks defined by the function.
  152. **Instructions**
  153. The number of instructions defined by the function.
  154. **Long Instructions**
  155. The number of instructions using the long instruction format in the function.
  156. **Operands**
  157. The number of operands used by all instructions in the function.
  158. **Instruction Size**
  159. The number of bytes consumed by instructions in the function.
  160. **Average Instruction Size**
  161. The average number of bytes consumed by the instructions in the function.
  162. This value is computed by dividing Instruction Size by Instructions.
  163. **Bytes Per Instruction**
  164. The average number of bytes used by the function per instruction. This value
  165. is computed by dividing Byte Size by Instructions. Note that this is not the
  166. same as Average Instruction Size. It computes a number relative to the total
  167. function size not just the size of the instruction list.
  168. **Number of VBR 32-bit Integers**
  169. The total number of 32-bit integers found in this function (for any use).
  170. **Number of VBR 64-bit Integers**
  171. The total number of 64-bit integers found in this function (for any use).
  172. **Number of VBR Compressed Bytes**
  173. The total number of bytes in this function consumed by the 32-bit and 64-bit
  174. integers that use the Variable Bit Rate encoding scheme.
  175. **Number of VBR Expanded Bytes**
  176. The total number of bytes in this function that would have been consumed by
  177. the 32-bit and 64-bit integers had they not been compressed with the Variable
  178. Bit Rate encoding scheme.
  179. **Bytes Saved With VBR**
  180. The total number of bytes saved in this function by using the Variable Bit
  181. Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
  182. SEE ALSO
  183. --------
  184. :manpage:`llvm-dis(1)`, :doc:`/BitCodeFormat`