1=pod 2 3=head1 NAME 4 5llvm-bcanalyzer - LLVM bitcode analyzer 6 7=head1 SYNOPSIS 8 9B<llvm-bcanalyzer> [I<options>] [F<filename>] 10 11=head1 DESCRIPTION 12 13The B<llvm-bcanalyzer> command is a small utility for analyzing bitcode files. 14The tool reads a bitcode file (such as generated with the B<llvm-as> tool) and 15produces a statistical report on the contents of the bitcode file. The tool 16can also dump a low level but human readable version of the bitcode file. 17This tool is probably not of much interest or utility except for those working 18directly with the bitcode file format. Most LLVM users can just ignore 19this tool. 20 21If F<filename> is omitted or is C<->, then B<llvm-bcanalyzer> reads its input 22from standard input. This is useful for combining the tool into a pipeline. 23Output is written to the standard output. 24 25=head1 OPTIONS 26 27=over 28 29=item B<-nodetails> 30 31Causes B<llvm-bcanalyzer> to abbreviate its output by writing out only a module 32level summary. The details for individual functions are not displayed. 33 34=item B<-dump> 35 36Causes B<llvm-bcanalyzer> to dump the bitcode in a human readable format. This 37format is significantly different from LLVM assembly and provides details about 38the encoding of the bitcode file. 39 40=item B<-verify> 41 42Causes B<llvm-bcanalyzer> to verify the module produced by reading the 43bitcode. This ensures that the statistics generated are based on a consistent 44module. 45 46=item B<-help> 47 48Print a summary of command line options. 49 50=back 51 52=head1 EXIT STATUS 53 54If B<llvm-bcanalyzer> succeeds, it will exit with 0. Otherwise, if an error 55occurs, it will exit with a non-zero value, usually 1. 56 57=head1 SUMMARY OUTPUT DEFINITIONS 58 59The following items are always printed by llvm-bcanalyzer. They comprize the 60summary output. 61 62=over 63 64=item B<Bitcode Analysis Of Module> 65 66This just provides the name of the module for which bitcode analysis is being 67generated. 68 69=item B<Bitcode Version Number> 70 71The bitcode version (not LLVM version) of the file read by the analyzer. 72 73=item B<File Size> 74 75The size, in bytes, of the entire bitcode file. 76 77=item B<Module Bytes> 78 79The size, in bytes, of the module block. Percentage is relative to File Size. 80 81=item B<Function Bytes> 82 83The size, in bytes, of all the function blocks. Percentage is relative to File 84Size. 85 86=item B<Global Types Bytes> 87 88The size, in bytes, of the Global Types Pool. Percentage is relative to File 89Size. This is the size of the definitions of all types in the bitcode file. 90 91=item B<Constant Pool Bytes> 92 93The size, in bytes, of the Constant Pool Blocks Percentage is relative to File 94Size. 95 96=item B<Module Globals Bytes> 97 98Ths size, in bytes, of the Global Variable Definitions and their initializers. 99Percentage is relative to File Size. 100 101=item B<Instruction List Bytes> 102 103The size, in bytes, of all the instruction lists in all the functions. 104Percentage is relative to File Size. Note that this value is also included in 105the Function Bytes. 106 107=item B<Compaction Table Bytes> 108 109The size, in bytes, of all the compaction tables in all the functions. 110Percentage is relative to File Size. Note that this value is also included in 111the Function Bytes. 112 113=item B<Symbol Table Bytes> 114 115The size, in bytes, of all the symbol tables in all the functions. Percentage is 116relative to File Size. Note that this value is also included in the Function 117Bytes. 118 119=item B<Dependent Libraries Bytes> 120 121The size, in bytes, of the list of dependent libraries in the module. Percentage 122is relative to File Size. Note that this value is also included in the Module 123Global Bytes. 124 125=item B<Number Of Bitcode Blocks> 126 127The total number of blocks of any kind in the bitcode file. 128 129=item B<Number Of Functions> 130 131The total number of function definitions in the bitcode file. 132 133=item B<Number Of Types> 134 135The total number of types defined in the Global Types Pool. 136 137=item B<Number Of Constants> 138 139The total number of constants (of any type) defined in the Constant Pool. 140 141=item B<Number Of Basic Blocks> 142 143The total number of basic blocks defined in all functions in the bitcode file. 144 145=item B<Number Of Instructions> 146 147The total number of instructions defined in all functions in the bitcode file. 148 149=item B<Number Of Long Instructions> 150 151The total number of long instructions defined in all functions in the bitcode 152file. Long instructions are those taking greater than 4 bytes. Typically long 153instructions are GetElementPtr with several indices, PHI nodes, and calls to 154functions with large numbers of arguments. 155 156=item B<Number Of Operands> 157 158The total number of operands used in all instructions in the bitcode file. 159 160=item B<Number Of Compaction Tables> 161 162The total number of compaction tables in all functions in the bitcode file. 163 164=item B<Number Of Symbol Tables> 165 166The total number of symbol tables in all functions in the bitcode file. 167 168=item B<Number Of Dependent Libs> 169 170The total number of dependent libraries found in the bitcode file. 171 172=item B<Total Instruction Size> 173 174The total size of the instructions in all functions in the bitcode file. 175 176=item B<Average Instruction Size> 177 178The average number of bytes per instruction across all functions in the bitcode 179file. This value is computed by dividing Total Instruction Size by Number Of 180Instructions. 181 182=item B<Maximum Type Slot Number> 183 184The maximum value used for a type's slot number. Larger slot number values take 185more bytes to encode. 186 187=item B<Maximum Value Slot Number> 188 189The maximum value used for a value's slot number. Larger slot number values take 190more bytes to encode. 191 192=item B<Bytes Per Value> 193 194The average size of a Value definition (of any type). This is computed by 195dividing File Size by the total number of values of any type. 196 197=item B<Bytes Per Global> 198 199The average size of a global definition (constants and global variables). 200 201=item B<Bytes Per Function> 202 203The average number of bytes per function definition. This is computed by 204dividing Function Bytes by Number Of Functions. 205 206=item B<# of VBR 32-bit Integers> 207 208The total number of 32-bit integers encoded using the Variable Bit Rate 209encoding scheme. 210 211=item B<# of VBR 64-bit Integers> 212 213The total number of 64-bit integers encoded using the Variable Bit Rate encoding 214scheme. 215 216=item B<# of VBR Compressed Bytes> 217 218The total number of bytes consumed by the 32-bit and 64-bit integers that use 219the Variable Bit Rate encoding scheme. 220 221=item B<# of VBR Expanded Bytes> 222 223The total number of bytes that would have been consumed by the 32-bit and 64-bit 224integers had they not been compressed with the Variable Bit Rage encoding 225scheme. 226 227=item B<Bytes Saved With VBR> 228 229The total number of bytes saved by using the Variable Bit Rate encoding scheme. 230The percentage is relative to # of VBR Expanded Bytes. 231 232=back 233 234=head1 DETAILED OUTPUT DEFINITIONS 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=over 240 241=item B<Type> 242 243The type signature of the function. 244 245=item B<Byte Size> 246 247The total number of bytes in the function's block. 248 249=item B<Basic Blocks> 250 251The number of basic blocks defined by the function. 252 253=item B<Instructions> 254 255The number of instructions defined by the function. 256 257=item B<Long Instructions> 258 259The number of instructions using the long instruction format in the function. 260 261=item B<Operands> 262 263The number of operands used by all instructions in the function. 264 265=item B<Instruction Size> 266 267The number of bytes consumed by instructions in the function. 268 269=item B<Average Instruction Size> 270 271The average number of bytes consumed by the instructions in the function. This 272value is computed by dividing Instruction Size by Instructions. 273 274=item B<Bytes Per Instruction> 275 276The average number of bytes used by the function per instruction. This value is 277computed by dividing Byte Size by Instructions. Note that this is not the same 278as Average Instruction Size. It computes a number relative to the total function 279size not just the size of the instruction list. 280 281=item B<Number of VBR 32-bit Integers> 282 283The total number of 32-bit integers found in this function (for any use). 284 285=item B<Number of VBR 64-bit Integers> 286 287The total number of 64-bit integers found in this function (for any use). 288 289=item B<Number of VBR Compressed Bytes> 290 291The total number of bytes in this function consumed by the 32-bit and 64-bit 292integers that use the Variable Bit Rate encoding scheme. 293 294=item B<Number of VBR Expanded Bytes> 295 296The total number of bytes in this function that would have been consumed by 297the 32-bit and 64-bit integers had they not been compressed with the Variable 298Bit Rate encoding scheme. 299 300=item B<Bytes Saved With VBR> 301 302The total number of bytes saved in this function by using the Variable Bit 303Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes. 304 305=back 306 307=head1 SEE ALSO 308 309L<llvm-dis|llvm-dis>, L<http://llvm.org/docs/BitCodeFormat.html> 310 311=head1 AUTHORS 312 313Maintained by the LLVM Team (L<http://llvm.org/>). 314 315=cut 316