[PowerPC] Do not emit record-form rotates when record-form andi/andis suffices
[llvm-core.git] / docs / CommandGuide / llvm-bcanalyzer.rst
blob7254088ec9461c9fb61703f9647331b4fbbdc6c4
1 llvm-bcanalyzer - LLVM bitcode analyzer
2 =======================================
4 SYNOPSIS
5 --------
7 :program:`llvm-bcanalyzer` [*options*] [*filename*]
9 DESCRIPTION
10 -----------
12 The :program:`llvm-bcanalyzer` command is a small utility for analyzing bitcode
13 files.  The tool reads a bitcode file (such as generated with the
14 :program:`llvm-as` tool) and produces a statistical report on the contents of
15 the bitcode file.  The tool can also dump a low level but human readable
16 version of the bitcode file.  This tool is probably not of much interest or
17 utility except for those working directly with the bitcode file format.  Most
18 LLVM users can just ignore this tool.
20 If *filename* is omitted or is ``-``, then :program:`llvm-bcanalyzer` reads its
21 input from standard input.  This is useful for combining the tool into a
22 pipeline.  Output is written to the standard output.
24 OPTIONS
25 -------
27 .. program:: llvm-bcanalyzer
29 .. option:: -nodetails
31  Causes :program:`llvm-bcanalyzer` to abbreviate its output by writing out only
32  a module level summary.  The details for individual functions are not
33  displayed.
35 .. option:: -dump
37  Causes :program:`llvm-bcanalyzer` to dump the bitcode in a human readable
38  format.  This format is significantly different from LLVM assembly and
39  provides details about the encoding of the bitcode file.
41 .. option:: -verify
43  Causes :program:`llvm-bcanalyzer` to verify the module produced by reading the
44  bitcode.  This ensures that the statistics generated are based on a consistent
45  module.
47 .. option:: -help
49  Print a summary of command line options.
51 EXIT STATUS
52 -----------
54 If :program:`llvm-bcanalyzer` succeeds, it will exit with 0.  Otherwise, if an
55 error occurs, it will exit with a non-zero value, usually 1.
57 SUMMARY OUTPUT DEFINITIONS
58 --------------------------
60 The following items are always printed by llvm-bcanalyzer.  They comprize the
61 summary output.
63 **Bitcode Analysis Of Module**
65  This just provides the name of the module for which bitcode analysis is being
66  generated.
68 **Bitcode Version Number**
70  The bitcode version (not LLVM version) of the file read by the analyzer.
72 **File Size**
74  The size, in bytes, of the entire bitcode file.
76 **Module Bytes**
78  The size, in bytes, of the module block.  Percentage is relative to File Size.
80 **Function Bytes**
82  The size, in bytes, of all the function blocks.  Percentage is relative to File
83  Size.
85 **Global Types Bytes**
87  The size, in bytes, of the Global Types Pool.  Percentage is relative to File
88  Size.  This is the size of the definitions of all types in the bitcode file.
90 **Constant Pool Bytes**
92  The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
93  Size.
95 **Module Globals Bytes**
97  Ths size, in bytes, of the Global Variable Definitions and their initializers.
98  Percentage is relative to File Size.
100 **Instruction List Bytes**
102  The size, in bytes, of all the instruction lists in all the functions.
103  Percentage is relative to File Size.  Note that this value is also included in
104  the Function Bytes.
106 **Compaction Table Bytes**
108  The size, in bytes, of all the compaction tables in all the functions.
109  Percentage is relative to File Size.  Note that this value is also included in
110  the Function Bytes.
112 **Symbol Table Bytes**
114  The size, in bytes, of all the symbol tables in all the functions.  Percentage is
115  relative to File Size.  Note that this value is also included in the Function
116  Bytes.
118 **Dependent Libraries Bytes**
120  The size, in bytes, of the list of dependent libraries in the module.  Percentage
121  is relative to File Size.  Note that this value is also included in the Module
122  Global Bytes.
124 **Number Of Bitcode Blocks**
126  The total number of blocks of any kind in the bitcode file.
128 **Number Of Functions**
130  The total number of function definitions in the bitcode file.
132 **Number Of Types**
134  The total number of types defined in the Global Types Pool.
136 **Number Of Constants**
138  The total number of constants (of any type) defined in the Constant Pool.
140 **Number Of Basic Blocks**
142  The total number of basic blocks defined in all functions in the bitcode file.
144 **Number Of Instructions**
146  The total number of instructions defined in all functions in the bitcode file.
148 **Number Of Long Instructions**
150  The total number of long instructions defined in all functions in the bitcode
151  file.  Long instructions are those taking greater than 4 bytes.  Typically long
152  instructions are GetElementPtr with several indices, PHI nodes, and calls to
153  functions with large numbers of arguments.
155 **Number Of Operands**
157  The total number of operands used in all instructions in the bitcode file.
159 **Number Of Compaction Tables**
161  The total number of compaction tables in all functions in the bitcode file.
163 **Number Of Symbol Tables**
165  The total number of symbol tables in all functions in the bitcode file.
167 **Number Of Dependent Libs**
169  The total number of dependent libraries found in the bitcode file.
171 **Total Instruction Size**
173  The total size of the instructions in all functions in the bitcode file.
175 **Average Instruction Size**
177  The average number of bytes per instruction across all functions in the bitcode
178  file.  This value is computed by dividing Total Instruction Size by Number Of
179  Instructions.
181 **Maximum Type Slot Number**
183  The maximum value used for a type's slot number.  Larger slot number values take
184  more bytes to encode.
186 **Maximum Value Slot Number**
188  The maximum value used for a value's slot number.  Larger slot number values take
189  more bytes to encode.
191 **Bytes Per Value**
193  The average size of a Value definition (of any type).  This is computed by
194  dividing File Size by the total number of values of any type.
196 **Bytes Per Global**
198  The average size of a global definition (constants and global variables).
200 **Bytes Per Function**
202  The average number of bytes per function definition.  This is computed by
203  dividing Function Bytes by Number Of Functions.
205 **# of VBR 32-bit Integers**
207  The total number of 32-bit integers encoded using the Variable Bit Rate
208  encoding scheme.
210 **# of VBR 64-bit Integers**
212  The total number of 64-bit integers encoded using the Variable Bit Rate encoding
213  scheme.
215 **# of VBR Compressed Bytes**
217  The total number of bytes consumed by the 32-bit and 64-bit integers that use
218  the Variable Bit Rate encoding scheme.
220 **# of VBR Expanded Bytes**
222  The total number of bytes that would have been consumed by the 32-bit and 64-bit
223  integers had they not been compressed with the Variable Bit Rage encoding
224  scheme.
226 **Bytes Saved With VBR**
228  The total number of bytes saved by using the Variable Bit Rate encoding scheme.
229  The percentage is relative to # of VBR Expanded Bytes.
231 DETAILED OUTPUT DEFINITIONS
232 ---------------------------
234 The following definitions occur only if the -nodetails option was not given.
235 The detailed output provides additional information on a per-function basis.
237 **Type**
239  The type signature of the function.
241 **Byte Size**
243  The total number of bytes in the function's block.
245 **Basic Blocks**
247  The number of basic blocks defined by the function.
249 **Instructions**
251  The number of instructions defined by the function.
253 **Long Instructions**
255  The number of instructions using the long instruction format in the function.
257 **Operands**
259  The number of operands used by all instructions in the function.
261 **Instruction Size**
263  The number of bytes consumed by instructions in the function.
265 **Average Instruction Size**
267  The average number of bytes consumed by the instructions in the function.
268  This value is computed by dividing Instruction Size by Instructions.
270 **Bytes Per Instruction**
272  The average number of bytes used by the function per instruction.  This value
273  is computed by dividing Byte Size by Instructions.  Note that this is not the
274  same as Average Instruction Size.  It computes a number relative to the total
275  function size not just the size of the instruction list.
277 **Number of VBR 32-bit Integers**
279  The total number of 32-bit integers found in this function (for any use).
281 **Number of VBR 64-bit Integers**
283  The total number of 64-bit integers found in this function (for any use).
285 **Number of VBR Compressed Bytes**
287  The total number of bytes in this function consumed by the 32-bit and 64-bit
288  integers that use the Variable Bit Rate encoding scheme.
290 **Number of VBR Expanded Bytes**
292  The total number of bytes in this function that would have been consumed by
293  the 32-bit and 64-bit integers had they not been compressed with the Variable
294  Bit Rate encoding scheme.
296 **Bytes Saved With VBR**
298  The total number of bytes saved in this function by using the Variable Bit
299  Rate encoding scheme.  The percentage is relative to # of VBR Expanded Bytes.
301 SEE ALSO
302 --------
304 :doc:`/CommandGuide/llvm-dis`, :doc:`/BitCodeFormat`