5 llvm-bcanalyzer - LLVM bitcode analyzer
9 B<llvm-bcanalyzer> [I<options>] [F<filename>]
13 The B<llvm-bcanalyzer> command is a small utility for analyzing bitcode files.
14 The tool reads a bitcode file (such as generated with the B<llvm-as> tool) and
15 produces a statistical report on the contents of the bitcode file. The tool
16 can also dump a low level but human readable version of the bitcode file.
17 This tool is probably not of much interest or utility except for those working
18 directly with the bitcode file format. Most LLVM users can just ignore
21 If F<filename> is omitted or is C<->, then B<llvm-bcanalyzer> reads its input
22 from standard input. This is useful for combining the tool into a pipeline.
23 Output is written to the standard output.
31 Causes B<llvm-bcanalyzer> to abbreviate its output by writing out only a module
32 level summary. The details for individual functions are not displayed.
36 Causes B<llvm-bcanalyzer> to dump the bitcode in a human readable format. This
37 format is significantly different from LLVM assembly and provides details about
38 the encoding of the bitcode file.
42 Causes B<llvm-bcanalyzer> to verify the module produced by reading the
43 bitcode. This ensures that the statistics generated are based on a consistent
48 Print a summary of command line options.
54 If B<llvm-bcanalyzer> succeeds, it will exit with 0. Otherwise, if an error
55 occurs, it will exit with a non-zero value, usually 1.
57 =head1 SUMMARY OUTPUT DEFINITIONS
59 The following items are always printed by llvm-bcanalyzer. They comprize the
64 =item B<Bitcode Analysis Of Module>
66 This just provides the name of the module for which bitcode analysis is being
69 =item B<Bitcode Version Number>
71 The bitcode version (not LLVM version) of the file read by the analyzer.
75 The size, in bytes, of the entire bitcode file.
79 The size, in bytes, of the module block. Percentage is relative to File Size.
81 =item B<Function Bytes>
83 The size, in bytes, of all the function blocks. Percentage is relative to File
86 =item B<Global Types Bytes>
88 The size, in bytes, of the Global Types Pool. Percentage is relative to File
89 Size. This is the size of the definitions of all types in the bitcode file.
91 =item B<Constant Pool Bytes>
93 The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
96 =item B<Module Globals Bytes>
98 Ths size, in bytes, of the Global Variable Definitions and their initializers.
99 Percentage is relative to File Size.
101 =item B<Instruction List Bytes>
103 The size, in bytes, of all the instruction lists in all the functions.
104 Percentage is relative to File Size. Note that this value is also included in
107 =item B<Compaction Table Bytes>
109 The size, in bytes, of all the compaction tables in all the functions.
110 Percentage is relative to File Size. Note that this value is also included in
113 =item B<Symbol Table Bytes>
115 The size, in bytes, of all the symbol tables in all the functions. Percentage is
116 relative to File Size. Note that this value is also included in the Function
119 =item B<Dependent Libraries Bytes>
121 The size, in bytes, of the list of dependent libraries in the module. Percentage
122 is relative to File Size. Note that this value is also included in the Module
125 =item B<Number Of Bitcode Blocks>
127 The total number of blocks of any kind in the bitcode file.
129 =item B<Number Of Functions>
131 The total number of function definitions in the bitcode file.
133 =item B<Number Of Types>
135 The total number of types defined in the Global Types Pool.
137 =item B<Number Of Constants>
139 The total number of constants (of any type) defined in the Constant Pool.
141 =item B<Number Of Basic Blocks>
143 The total number of basic blocks defined in all functions in the bitcode file.
145 =item B<Number Of Instructions>
147 The total number of instructions defined in all functions in the bitcode file.
149 =item B<Number Of Long Instructions>
151 The total number of long instructions defined in all functions in the bitcode
152 file. Long instructions are those taking greater than 4 bytes. Typically long
153 instructions are GetElementPtr with several indices, PHI nodes, and calls to
154 functions with large numbers of arguments.
156 =item B<Number Of Operands>
158 The total number of operands used in all instructions in the bitcode file.
160 =item B<Number Of Compaction Tables>
162 The total number of compaction tables in all functions in the bitcode file.
164 =item B<Number Of Symbol Tables>
166 The total number of symbol tables in all functions in the bitcode file.
168 =item B<Number Of Dependent Libs>
170 The total number of dependent libraries found in the bitcode file.
172 =item B<Total Instruction Size>
174 The total size of the instructions in all functions in the bitcode file.
176 =item B<Average Instruction Size>
178 The average number of bytes per instruction across all functions in the bitcode
179 file. This value is computed by dividing Total Instruction Size by Number Of
182 =item B<Maximum Type Slot Number>
184 The maximum value used for a type's slot number. Larger slot number values take
185 more bytes to encode.
187 =item B<Maximum Value Slot Number>
189 The maximum value used for a value's slot number. Larger slot number values take
190 more bytes to encode.
192 =item B<Bytes Per Value>
194 The average size of a Value definition (of any type). This is computed by
195 dividing File Size by the total number of values of any type.
197 =item B<Bytes Per Global>
199 The average size of a global definition (constants and global variables).
201 =item B<Bytes Per Function>
203 The average number of bytes per function definition. This is computed by
204 dividing Function Bytes by Number Of Functions.
206 =item B<# of VBR 32-bit Integers>
208 The total number of 32-bit integers encoded using the Variable Bit Rate
211 =item B<# of VBR 64-bit Integers>
213 The total number of 64-bit integers encoded using the Variable Bit Rate encoding
216 =item B<# of VBR Compressed Bytes>
218 The total number of bytes consumed by the 32-bit and 64-bit integers that use
219 the Variable Bit Rate encoding scheme.
221 =item B<# of VBR Expanded Bytes>
223 The total number of bytes that would have been consumed by the 32-bit and 64-bit
224 integers had they not been compressed with the Variable Bit Rage encoding
227 =item B<Bytes Saved With VBR>
229 The total number of bytes saved by using the Variable Bit Rate encoding scheme.
230 The percentage is relative to # of VBR Expanded Bytes.
234 =head1 DETAILED OUTPUT DEFINITIONS
236 The following definitions occur only if the -nodetails option was not given.
237 The detailed output provides additional information on a per-function basis.
243 The type signature of the function.
247 The total number of bytes in the function's block.
249 =item B<Basic Blocks>
251 The number of basic blocks defined by the function.
253 =item B<Instructions>
255 The number of instructions defined by the function.
257 =item B<Long Instructions>
259 The number of instructions using the long instruction format in the function.
263 The number of operands used by all instructions in the function.
265 =item B<Instruction Size>
267 The number of bytes consumed by instructions in the function.
269 =item B<Average Instruction Size>
271 The average number of bytes consumed by the instructions in the function. This
272 value is computed by dividing Instruction Size by Instructions.
274 =item B<Bytes Per Instruction>
276 The average number of bytes used by the function per instruction. This value is
277 computed by dividing Byte Size by Instructions. Note that this is not the same
278 as Average Instruction Size. It computes a number relative to the total function
279 size not just the size of the instruction list.
281 =item B<Number of VBR 32-bit Integers>
283 The total number of 32-bit integers found in this function (for any use).
285 =item B<Number of VBR 64-bit Integers>
287 The total number of 64-bit integers found in this function (for any use).
289 =item B<Number of VBR Compressed Bytes>
291 The total number of bytes in this function consumed by the 32-bit and 64-bit
292 integers that use the Variable Bit Rate encoding scheme.
294 =item B<Number of VBR Expanded Bytes>
296 The total number of bytes in this function that would have been consumed by
297 the 32-bit and 64-bit integers had they not been compressed with the Variable
298 Bit Rate encoding scheme.
300 =item B<Bytes Saved With VBR>
302 The total number of bytes saved in this function by using the Variable Bit
303 Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
309 L<llvm-dis|llvm-dis>, L<http://llvm.org/docs/BitCodeFormat.html>
313 Maintained by the LLVM Team (L<http://llvm.org/>).