1llvm-bcanalyzer - LLVM bitcode analyzer 2======================================= 3 4.. program:: llvm-bcanalyzer 5 6SYNOPSIS 7-------- 8 9:program:`llvm-bcanalyzer` [*options*] [*filename*] 10 11DESCRIPTION 12----------- 13 14The :program:`llvm-bcanalyzer` command is a small utility for analyzing bitcode 15files. 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 17the bitcode file. The tool can also dump a low level but human readable 18version of the bitcode file. This tool is probably not of much interest or 19utility except for those working directly with the bitcode file format. Most 20LLVM users can just ignore this tool. 21 22If *filename* is omitted or is ``-``, then :program:`llvm-bcanalyzer` reads its 23input from standard input. This is useful for combining the tool into a 24pipeline. Output is written to the standard output. 25 26OPTIONS 27------- 28 29.. program:: llvm-bcanalyzer 30 31.. option:: -nodetails 32 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 35 displayed. 36 37.. option:: -dump 38 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. 42 43.. option:: -verify 44 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 47 module. 48 49.. option:: -help 50 51 Print a summary of command line options. 52 53EXIT STATUS 54----------- 55 56If :program:`llvm-bcanalyzer` succeeds, it will exit with 0. Otherwise, if an 57error occurs, it will exit with a non-zero value, usually 1. 58 59SUMMARY OUTPUT DEFINITIONS 60-------------------------- 61 62The following items are always printed by llvm-bcanalyzer. They comprize the 63summary output. 64 65**Bitcode Analysis Of Module** 66 67 This just provides the name of the module for which bitcode analysis is being 68 generated. 69 70**Bitcode Version Number** 71 72 The bitcode version (not LLVM version) of the file read by the analyzer. 73 74**File Size** 75 76 The size, in bytes, of the entire bitcode file. 77 78**Module Bytes** 79 80 The size, in bytes, of the module block. Percentage is relative to File Size. 81 82**Function Bytes** 83 84 The size, in bytes, of all the function blocks. Percentage is relative to File 85 Size. 86 87**Global Types Bytes** 88 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. 91 92**Constant Pool Bytes** 93 94 The size, in bytes, of the Constant Pool Blocks Percentage is relative to File 95 Size. 96 97**Module Globals Bytes** 98 99 Ths size, in bytes, of the Global Variable Definitions and their initializers. 100 Percentage is relative to File Size. 101 102**Instruction List Bytes** 103 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 106 the Function Bytes. 107 108**Compaction Table Bytes** 109 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 112 the Function Bytes. 113 114**Symbol Table Bytes** 115 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 118 Bytes. 119 120**Dependent Libraries Bytes** 121 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 124 Global Bytes. 125 126**Number Of Bitcode Blocks** 127 128 The total number of blocks of any kind in the bitcode file. 129 130**Number Of Functions** 131 132 The total number of function definitions in the bitcode file. 133 134**Number Of Types** 135 136 The total number of types defined in the Global Types Pool. 137 138**Number Of Constants** 139 140 The total number of constants (of any type) defined in the Constant Pool. 141 142**Number Of Basic Blocks** 143 144 The total number of basic blocks defined in all functions in the bitcode file. 145 146**Number Of Instructions** 147 148 The total number of instructions defined in all functions in the bitcode file. 149 150**Number Of Long Instructions** 151 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. 156 157**Number Of Operands** 158 159 The total number of operands used in all instructions in the bitcode file. 160 161**Number Of Compaction Tables** 162 163 The total number of compaction tables in all functions in the bitcode file. 164 165**Number Of Symbol Tables** 166 167 The total number of symbol tables in all functions in the bitcode file. 168 169**Number Of Dependent Libs** 170 171 The total number of dependent libraries found in the bitcode file. 172 173**Total Instruction Size** 174 175 The total size of the instructions in all functions in the bitcode file. 176 177**Average Instruction Size** 178 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 181 Instructions. 182 183**Maximum Type Slot Number** 184 185 The maximum value used for a type's slot number. Larger slot number values take 186 more bytes to encode. 187 188**Maximum Value Slot Number** 189 190 The maximum value used for a value's slot number. Larger slot number values take 191 more bytes to encode. 192 193**Bytes Per Value** 194 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. 197 198**Bytes Per Global** 199 200 The average size of a global definition (constants and global variables). 201 202**Bytes Per Function** 203 204 The average number of bytes per function definition. This is computed by 205 dividing Function Bytes by Number Of Functions. 206 207**# of VBR 32-bit Integers** 208 209 The total number of 32-bit integers encoded using the Variable Bit Rate 210 encoding scheme. 211 212**# of VBR 64-bit Integers** 213 214 The total number of 64-bit integers encoded using the Variable Bit Rate encoding 215 scheme. 216 217**# of VBR Compressed Bytes** 218 219 The total number of bytes consumed by the 32-bit and 64-bit integers that use 220 the Variable Bit Rate encoding scheme. 221 222**# of VBR Expanded Bytes** 223 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 226 scheme. 227 228**Bytes Saved With VBR** 229 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. 232 233DETAILED OUTPUT DEFINITIONS 234--------------------------- 235 236The following definitions occur only if the -nodetails option was not given. 237The detailed output provides additional information on a per-function basis. 238 239**Type** 240 241 The type signature of the function. 242 243**Byte Size** 244 245 The total number of bytes in the function's block. 246 247**Basic Blocks** 248 249 The number of basic blocks defined by the function. 250 251**Instructions** 252 253 The number of instructions defined by the function. 254 255**Long Instructions** 256 257 The number of instructions using the long instruction format in the function. 258 259**Operands** 260 261 The number of operands used by all instructions in the function. 262 263**Instruction Size** 264 265 The number of bytes consumed by instructions in the function. 266 267**Average Instruction Size** 268 269 The average number of bytes consumed by the instructions in the function. 270 This value is computed by dividing Instruction Size by Instructions. 271 272**Bytes Per Instruction** 273 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. 278 279**Number of VBR 32-bit Integers** 280 281 The total number of 32-bit integers found in this function (for any use). 282 283**Number of VBR 64-bit Integers** 284 285 The total number of 64-bit integers found in this function (for any use). 286 287**Number of VBR Compressed Bytes** 288 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. 291 292**Number of VBR Expanded Bytes** 293 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. 297 298**Bytes Saved With VBR** 299 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. 302 303SEE ALSO 304-------- 305 306:manpage:`llvm-dis(1)`, :doc:`/BitCodeFormat` 307