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
31 .. option:: -nodetails
33 Causes :program:`llvm-bcanalyzer` to abbreviate its output by writing out only
34 a module level summary. The details for individual functions are not
39 Causes :program:`llvm-bcanalyzer` to dump the bitcode in a human readable
40 format. This format is significantly different from LLVM assembly and
41 provides details about the encoding of the bitcode file.
45 Causes :program:`llvm-bcanalyzer` to verify the module produced by reading the
46 bitcode. This ensures that the statistics generated are based on a consistent
51 Print a summary of command line options.
56 If :program:`llvm-bcanalyzer` succeeds, it will exit with 0. Otherwise, if an
57 error occurs, it will exit with a non-zero value, usually 1.
59 SUMMARY OUTPUT DEFINITIONS
60 --------------------------
62 The following items are always printed by llvm-bcanalyzer. They comprize the
65 **Bitcode Analysis Of Module**
67 This just provides the name of the module for which bitcode analysis is being
70 **Bitcode Version Number**
72 The bitcode version (not LLVM version) of the file read by the analyzer.
76 The size, in bytes, of the entire bitcode file.
80 The size, in bytes, of the module block. Percentage is relative to File Size.
84 The size, in bytes, of all the function blocks. Percentage is relative to File
87 **Global Types Bytes**
89 The size, in bytes, of the Global Types Pool. Percentage is relative to File
90 Size. This is the size of the definitions of all types in the bitcode file.
92 **Constant Pool Bytes**
94 The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
97 **Module Globals Bytes**
99 Ths size, in bytes, of the Global Variable Definitions and their initializers.
100 Percentage is relative to File Size.
102 **Instruction List Bytes**
104 The size, in bytes, of all the instruction lists in all the functions.
105 Percentage is relative to File Size. Note that this value is also included in
108 **Compaction Table Bytes**
110 The size, in bytes, of all the compaction tables in all the functions.
111 Percentage is relative to File Size. Note that this value is also included in
114 **Symbol Table Bytes**
116 The size, in bytes, of all the symbol tables in all the functions. Percentage is
117 relative to File Size. Note that this value is also included in the Function
120 **Dependent Libraries Bytes**
122 The size, in bytes, of the list of dependent libraries in the module. Percentage
123 is relative to File Size. Note that this value is also included in the Module
126 **Number Of Bitcode Blocks**
128 The total number of blocks of any kind in the bitcode file.
130 **Number Of Functions**
132 The total number of function definitions in the bitcode file.
136 The total number of types defined in the Global Types Pool.
138 **Number Of Constants**
140 The total number of constants (of any type) defined in the Constant Pool.
142 **Number Of Basic Blocks**
144 The total number of basic blocks defined in all functions in the bitcode file.
146 **Number Of Instructions**
148 The total number of instructions defined in all functions in the bitcode file.
150 **Number Of Long Instructions**
152 The total number of long instructions defined in all functions in the bitcode
153 file. Long instructions are those taking greater than 4 bytes. Typically long
154 instructions are GetElementPtr with several indices, PHI nodes, and calls to
155 functions with large numbers of arguments.
157 **Number Of Operands**
159 The total number of operands used in all instructions in the bitcode file.
161 **Number Of Compaction Tables**
163 The total number of compaction tables in all functions in the bitcode file.
165 **Number Of Symbol Tables**
167 The total number of symbol tables in all functions in the bitcode file.
169 **Number Of Dependent Libs**
171 The total number of dependent libraries found in the bitcode file.
173 **Total Instruction Size**
175 The total size of the instructions in all functions in the bitcode file.
177 **Average Instruction Size**
179 The average number of bytes per instruction across all functions in the bitcode
180 file. This value is computed by dividing Total Instruction Size by Number Of
183 **Maximum Type Slot Number**
185 The maximum value used for a type's slot number. Larger slot number values take
186 more bytes to encode.
188 **Maximum Value Slot Number**
190 The maximum value used for a value's slot number. Larger slot number values take
191 more bytes to encode.
195 The average size of a Value definition (of any type). This is computed by
196 dividing File Size by the total number of values of any type.
200 The average size of a global definition (constants and global variables).
202 **Bytes Per Function**
204 The average number of bytes per function definition. This is computed by
205 dividing Function Bytes by Number Of Functions.
207 **# of VBR 32-bit Integers**
209 The total number of 32-bit integers encoded using the Variable Bit Rate
212 **# of VBR 64-bit Integers**
214 The total number of 64-bit integers encoded using the Variable Bit Rate encoding
217 **# of VBR Compressed Bytes**
219 The total number of bytes consumed by the 32-bit and 64-bit integers that use
220 the Variable Bit Rate encoding scheme.
222 **# of VBR Expanded Bytes**
224 The total number of bytes that would have been consumed by the 32-bit and 64-bit
225 integers had they not been compressed with the Variable Bit Rage encoding
228 **Bytes Saved With VBR**
230 The total number of bytes saved by using the Variable Bit Rate encoding scheme.
231 The percentage is relative to # of VBR Expanded Bytes.
233 DETAILED OUTPUT DEFINITIONS
234 ---------------------------
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.
241 The type signature of the function.
245 The total number of bytes in the function's block.
249 The number of basic blocks defined by the function.
253 The number of instructions defined by the function.
255 **Long Instructions**
257 The number of instructions using the long instruction format in the function.
261 The number of operands used by all instructions in the function.
265 The number of bytes consumed by instructions in the function.
267 **Average Instruction Size**
269 The average number of bytes consumed by the instructions in the function.
270 This value is computed by dividing Instruction Size by Instructions.
272 **Bytes Per Instruction**
274 The average number of bytes used by the function per instruction. This value
275 is computed by dividing Byte Size by Instructions. Note that this is not the
276 same as Average Instruction Size. It computes a number relative to the total
277 function size not just the size of the instruction list.
279 **Number of VBR 32-bit Integers**
281 The total number of 32-bit integers found in this function (for any use).
283 **Number of VBR 64-bit Integers**
285 The total number of 64-bit integers found in this function (for any use).
287 **Number of VBR Compressed Bytes**
289 The total number of bytes in this function consumed by the 32-bit and 64-bit
290 integers that use the Variable Bit Rate encoding scheme.
292 **Number of VBR Expanded Bytes**
294 The total number of bytes in this function that would have been consumed by
295 the 32-bit and 64-bit integers had they not been compressed with the Variable
296 Bit Rate encoding scheme.
298 **Bytes Saved With VBR**
300 The total number of bytes saved in this function by using the Variable Bit
301 Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
306 :manpage:`llvm-dis(1)`, :doc:`/BitCodeFormat`