1 llvm-bcanalyzer - LLVM bitcode analyzer
2 =======================================
4 .. program:: llvm-bcanalyzer
9 :program:`llvm-bcanalyzer` [*options*] [*filename*]
14 The :program:`llvm-bcanalyzer` command is a small utility for analyzing bitcode
15 files. The tool reads a bitcode file (such as generated with the
16 :program:`llvm-as` tool) and produces a statistical report on the contents of
17 the bitcode file. The tool can also dump a low level but human readable
18 version of the bitcode file. This tool is probably not of much interest or
19 utility except for those working directly with the bitcode file format. Most
20 LLVM users can just ignore this tool.
22 If *filename* is omitted or is ``-``, then :program:`llvm-bcanalyzer` reads its
23 input from standard input. This is useful for combining the tool into a
24 pipeline. Output is written to the standard output.
29 .. program:: llvm-bcanalyzer
33 Causes :program:`llvm-bcanalyzer` to dump the bitcode in a human readable
34 format. This format is significantly different from LLVM assembly and
35 provides details about the encoding of the bitcode file.
39 Print a summary of command line options.
44 If :program:`llvm-bcanalyzer` succeeds, it will exit with 0. Otherwise, if an
45 error occurs, it will exit with a non-zero value, usually 1.
47 SUMMARY OUTPUT DEFINITIONS
48 --------------------------
50 The following items are always printed by llvm-bcanalyzer. They comprize the
53 **Bitcode Analysis Of Module**
55 This just provides the name of the module for which bitcode analysis is being
58 **Bitcode Version Number**
60 The bitcode version (not LLVM version) of the file read by the analyzer.
64 The size, in bytes, of the entire bitcode file.
68 The size, in bytes, of the module block. Percentage is relative to File Size.
72 The size, in bytes, of all the function blocks. Percentage is relative to File
75 **Global Types Bytes**
77 The size, in bytes, of the Global Types Pool. Percentage is relative to File
78 Size. This is the size of the definitions of all types in the bitcode file.
80 **Constant Pool Bytes**
82 The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
85 **Module Globals Bytes**
87 Ths size, in bytes, of the Global Variable Definitions and their initializers.
88 Percentage is relative to File Size.
90 **Instruction List Bytes**
92 The size, in bytes, of all the instruction lists in all the functions.
93 Percentage is relative to File Size. Note that this value is also included in
96 **Compaction Table Bytes**
98 The size, in bytes, of all the compaction tables in all the functions.
99 Percentage is relative to File Size. Note that this value is also included in
102 **Symbol Table Bytes**
104 The size, in bytes, of all the symbol tables in all the functions. Percentage is
105 relative to File Size. Note that this value is also included in the Function
108 **Dependent Libraries Bytes**
110 The size, in bytes, of the list of dependent libraries in the module. Percentage
111 is relative to File Size. Note that this value is also included in the Module
114 **Number Of Bitcode Blocks**
116 The total number of blocks of any kind in the bitcode file.
118 **Number Of Functions**
120 The total number of function definitions in the bitcode file.
124 The total number of types defined in the Global Types Pool.
126 **Number Of Constants**
128 The total number of constants (of any type) defined in the Constant Pool.
130 **Number Of Basic Blocks**
132 The total number of basic blocks defined in all functions in the bitcode file.
134 **Number Of Instructions**
136 The total number of instructions defined in all functions in the bitcode file.
138 **Number Of Long Instructions**
140 The total number of long instructions defined in all functions in the bitcode
141 file. Long instructions are those taking greater than 4 bytes. Typically long
142 instructions are GetElementPtr with several indices, PHI nodes, and calls to
143 functions with large numbers of arguments.
145 **Number Of Operands**
147 The total number of operands used in all instructions in the bitcode file.
149 **Number Of Compaction Tables**
151 The total number of compaction tables in all functions in the bitcode file.
153 **Number Of Symbol Tables**
155 The total number of symbol tables in all functions in the bitcode file.
157 **Number Of Dependent Libs**
159 The total number of dependent libraries found in the bitcode file.
161 **Total Instruction Size**
163 The total size of the instructions in all functions in the bitcode file.
165 **Average Instruction Size**
167 The average number of bytes per instruction across all functions in the bitcode
168 file. This value is computed by dividing Total Instruction Size by Number Of
171 **Maximum Type Slot Number**
173 The maximum value used for a type's slot number. Larger slot number values take
174 more bytes to encode.
176 **Maximum Value Slot Number**
178 The maximum value used for a value's slot number. Larger slot number values take
179 more bytes to encode.
183 The average size of a Value definition (of any type). This is computed by
184 dividing File Size by the total number of values of any type.
188 The average size of a global definition (constants and global variables).
190 **Bytes Per Function**
192 The average number of bytes per function definition. This is computed by
193 dividing Function Bytes by Number Of Functions.
195 **# of VBR 32-bit Integers**
197 The total number of 32-bit integers encoded using the Variable Bit Rate
200 **# of VBR 64-bit Integers**
202 The total number of 64-bit integers encoded using the Variable Bit Rate encoding
205 **# of VBR Compressed Bytes**
207 The total number of bytes consumed by the 32-bit and 64-bit integers that use
208 the Variable Bit Rate encoding scheme.
210 **# of VBR Expanded Bytes**
212 The total number of bytes that would have been consumed by the 32-bit and 64-bit
213 integers had they not been compressed with the Variable Bit Rage encoding
216 **Bytes Saved With VBR**
218 The total number of bytes saved by using the Variable Bit Rate encoding scheme.
219 The percentage is relative to # of VBR Expanded Bytes.
221 DETAILED OUTPUT DEFINITIONS
222 ---------------------------
224 The following definitions occur only if the -nodetails option was not given.
225 The detailed output provides additional information on a per-function basis.
229 The type signature of the function.
233 The total number of bytes in the function's block.
237 The number of basic blocks defined by the function.
241 The number of instructions defined by the function.
243 **Long Instructions**
245 The number of instructions using the long instruction format in the function.
249 The number of operands used by all instructions in the function.
253 The number of bytes consumed by instructions in the function.
255 **Average Instruction Size**
257 The average number of bytes consumed by the instructions in the function.
258 This value is computed by dividing Instruction Size by Instructions.
260 **Bytes Per Instruction**
262 The average number of bytes used by the function per instruction. This value
263 is computed by dividing Byte Size by Instructions. Note that this is not the
264 same as Average Instruction Size. It computes a number relative to the total
265 function size not just the size of the instruction list.
267 **Number of VBR 32-bit Integers**
269 The total number of 32-bit integers found in this function (for any use).
271 **Number of VBR 64-bit Integers**
273 The total number of 64-bit integers found in this function (for any use).
275 **Number of VBR Compressed Bytes**
277 The total number of bytes in this function consumed by the 32-bit and 64-bit
278 integers that use the Variable Bit Rate encoding scheme.
280 **Number of VBR Expanded Bytes**
282 The total number of bytes in this function that would have been consumed by
283 the 32-bit and 64-bit integers had they not been compressed with the Variable
284 Bit Rate encoding scheme.
286 **Bytes Saved With VBR**
288 The total number of bytes saved in this function by using the Variable Bit
289 Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
294 :manpage:`llvm-dis(1)`, :doc:`/BitCodeFormat`