1 llvm-bcanalyzer - LLVM bitcode analyzer
2 =======================================
9 **llvm-bcanalyzer** [*options*] [*filename*]
16 The **llvm-bcanalyzer** command is a small utility for analyzing bitcode files.
17 The tool reads a bitcode file (such as generated with the **llvm-as** tool) and
18 produces a statistical report on the contents of the bitcode file. The tool
19 can also dump a low level but human readable version of the bitcode file.
20 This tool is probably not of much interest or utility except for those working
21 directly with the bitcode file format. Most LLVM users can just ignore
24 If *filename* is omitted or is ``-``, then **llvm-bcanalyzer** reads its input
25 from standard input. This is useful for combining the tool into a pipeline.
26 Output is written to the standard output.
36 Causes **llvm-bcanalyzer** to abbreviate its output by writing out only a module
37 level summary. The details for individual functions are not displayed.
43 Causes **llvm-bcanalyzer** to dump the bitcode in a human readable format. This
44 format is significantly different from LLVM assembly and provides details about
45 the encoding of the bitcode file.
51 Causes **llvm-bcanalyzer** to verify the module produced by reading the
52 bitcode. This ensures that the statistics generated are based on a consistent
59 Print a summary of command line options.
68 If **llvm-bcanalyzer** succeeds, it will exit with 0. Otherwise, if an error
69 occurs, it will exit with a non-zero value, usually 1.
72 SUMMARY OUTPUT DEFINITIONS
73 --------------------------
76 The following items are always printed by llvm-bcanalyzer. They comprize the
80 **Bitcode Analysis Of Module**
82 This just provides the name of the module for which bitcode analysis is being
87 **Bitcode Version Number**
89 The bitcode version (not LLVM version) of the file read by the analyzer.
95 The size, in bytes, of the entire bitcode file.
101 The size, in bytes, of the module block. Percentage is relative to File Size.
107 The size, in bytes, of all the function blocks. Percentage is relative to File
112 **Global Types Bytes**
114 The size, in bytes, of the Global Types Pool. Percentage is relative to File
115 Size. This is the size of the definitions of all types in the bitcode file.
119 **Constant Pool Bytes**
121 The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
126 **Module Globals Bytes**
128 Ths size, in bytes, of the Global Variable Definitions and their initializers.
129 Percentage is relative to File Size.
133 **Instruction List Bytes**
135 The size, in bytes, of all the instruction lists in all the functions.
136 Percentage is relative to File Size. Note that this value is also included in
141 **Compaction Table Bytes**
143 The size, in bytes, of all the compaction tables in all the functions.
144 Percentage is relative to File Size. Note that this value is also included in
149 **Symbol Table Bytes**
151 The size, in bytes, of all the symbol tables in all the functions. Percentage is
152 relative to File Size. Note that this value is also included in the Function
157 **Dependent Libraries Bytes**
159 The size, in bytes, of the list of dependent libraries in the module. Percentage
160 is relative to File Size. Note that this value is also included in the Module
165 **Number Of Bitcode Blocks**
167 The total number of blocks of any kind in the bitcode file.
171 **Number Of Functions**
173 The total number of function definitions in the bitcode file.
179 The total number of types defined in the Global Types Pool.
183 **Number Of Constants**
185 The total number of constants (of any type) defined in the Constant Pool.
189 **Number Of Basic Blocks**
191 The total number of basic blocks defined in all functions in the bitcode file.
195 **Number Of Instructions**
197 The total number of instructions defined in all functions in the bitcode file.
201 **Number Of Long Instructions**
203 The total number of long instructions defined in all functions in the bitcode
204 file. Long instructions are those taking greater than 4 bytes. Typically long
205 instructions are GetElementPtr with several indices, PHI nodes, and calls to
206 functions with large numbers of arguments.
210 **Number Of Operands**
212 The total number of operands used in all instructions in the bitcode file.
216 **Number Of Compaction Tables**
218 The total number of compaction tables in all functions in the bitcode file.
222 **Number Of Symbol Tables**
224 The total number of symbol tables in all functions in the bitcode file.
228 **Number Of Dependent Libs**
230 The total number of dependent libraries found in the bitcode file.
234 **Total Instruction Size**
236 The total size of the instructions in all functions in the bitcode file.
240 **Average Instruction Size**
242 The average number of bytes per instruction across all functions in the bitcode
243 file. This value is computed by dividing Total Instruction Size by Number Of
248 **Maximum Type Slot Number**
250 The maximum value used for a type's slot number. Larger slot number values take
251 more bytes to encode.
255 **Maximum Value Slot Number**
257 The maximum value used for a value's slot number. Larger slot number values take
258 more bytes to encode.
264 The average size of a Value definition (of any type). This is computed by
265 dividing File Size by the total number of values of any type.
271 The average size of a global definition (constants and global variables).
275 **Bytes Per Function**
277 The average number of bytes per function definition. This is computed by
278 dividing Function Bytes by Number Of Functions.
282 **# of VBR 32-bit Integers**
284 The total number of 32-bit integers encoded using the Variable Bit Rate
289 **# of VBR 64-bit Integers**
291 The total number of 64-bit integers encoded using the Variable Bit Rate encoding
296 **# of VBR Compressed Bytes**
298 The total number of bytes consumed by the 32-bit and 64-bit integers that use
299 the Variable Bit Rate encoding scheme.
303 **# of VBR Expanded Bytes**
305 The total number of bytes that would have been consumed by the 32-bit and 64-bit
306 integers had they not been compressed with the Variable Bit Rage encoding
311 **Bytes Saved With VBR**
313 The total number of bytes saved by using the Variable Bit Rate encoding scheme.
314 The percentage is relative to # of VBR Expanded Bytes.
319 DETAILED OUTPUT DEFINITIONS
320 ---------------------------
323 The following definitions occur only if the -nodetails option was not given.
324 The detailed output provides additional information on a per-function basis.
329 The type signature of the function.
335 The total number of bytes in the function's block.
341 The number of basic blocks defined by the function.
347 The number of instructions defined by the function.
351 **Long Instructions**
353 The number of instructions using the long instruction format in the function.
359 The number of operands used by all instructions in the function.
365 The number of bytes consumed by instructions in the function.
369 **Average Instruction Size**
371 The average number of bytes consumed by the instructions in the function. This
372 value is computed by dividing Instruction Size by Instructions.
376 **Bytes Per Instruction**
378 The average number of bytes used by the function per instruction. This value is
379 computed by dividing Byte Size by Instructions. Note that this is not the same
380 as Average Instruction Size. It computes a number relative to the total function
381 size not just the size of the instruction list.
385 **Number of VBR 32-bit Integers**
387 The total number of 32-bit integers found in this function (for any use).
391 **Number of VBR 64-bit Integers**
393 The total number of 64-bit integers found in this function (for any use).
397 **Number of VBR Compressed Bytes**
399 The total number of bytes in this function consumed by the 32-bit and 64-bit
400 integers that use the Variable Bit Rate encoding scheme.
404 **Number of VBR Expanded Bytes**
406 The total number of bytes in this function that would have been consumed by
407 the 32-bit and 64-bit integers had they not been compressed with the Variable
408 Bit Rate encoding scheme.
412 **Bytes Saved With VBR**
414 The total number of bytes saved in this function by using the Variable Bit
415 Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
424 llvm-dis|llvm-dis, `http://llvm.org/docs/BitCodeFormat.html <http://llvm.org/docs/BitCodeFormat.html>`_