2004-07-02 05:44:14 +02:00
|
|
|
=pod
|
|
|
|
|
|
|
|
=head1 NAME
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
llvm-bcanalyzer - LLVM bitcode analyzer
|
2004-07-02 05:44:14 +02:00
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
|
|
|
|
2004-12-11 08:16:54 +01:00
|
|
|
B<llvm-bcanalyzer> [I<options>] [F<filename>]
|
2004-07-02 05:44:14 +02:00
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The B<llvm-bcanalyzer> command is a small utility for analyzing bitcode files.
|
|
|
|
The tool reads a bitcode file (such as generated with the B<llvm-as> tool) and
|
|
|
|
produces a statistical report on the contents of the bitcode file. The tool
|
|
|
|
can also dump a low level but human readable version of the bitcode file.
|
2004-07-02 05:44:14 +02:00
|
|
|
This tool is probably not of much interest or utility except for those working
|
2007-07-09 08:45:18 +02:00
|
|
|
directly with the bitcode file format. Most LLVM users can just ignore
|
2004-07-02 05:44:14 +02:00
|
|
|
this tool.
|
|
|
|
|
|
|
|
If F<filename> is omitted or is C<->, then B<llvm-bcanalyzer> reads its input
|
|
|
|
from standard input. This is useful for combining the tool into a pipeline.
|
|
|
|
Output is written to the standard output.
|
|
|
|
|
|
|
|
=head1 OPTIONS
|
|
|
|
|
|
|
|
=over
|
|
|
|
|
|
|
|
=item B<-nodetails>
|
|
|
|
|
|
|
|
Causes B<llvm-bcanalyzer> to abbreviate its output by writing out only a module
|
|
|
|
level summary. The details for individual functions are not displayed.
|
|
|
|
|
|
|
|
=item B<-dump>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
Causes B<llvm-bcanalyzer> to dump the bitcode in a human readable format. This
|
2004-07-02 05:44:14 +02:00
|
|
|
format is significantly different from LLVM assembly and provides details about
|
2007-07-09 08:45:18 +02:00
|
|
|
the encoding of the bitcode file.
|
2004-07-02 05:44:14 +02:00
|
|
|
|
|
|
|
=item B<-verify>
|
|
|
|
|
2004-12-11 08:16:54 +01:00
|
|
|
Causes B<llvm-bcanalyzer> to verify the module produced by reading the
|
2007-07-09 08:45:18 +02:00
|
|
|
bitcode. This ensures that the statistics generated are based on a consistent
|
2004-07-02 05:44:14 +02:00
|
|
|
module.
|
|
|
|
|
2010-02-18 15:08:13 +01:00
|
|
|
=item B<-help>
|
2004-07-02 05:44:14 +02:00
|
|
|
|
|
|
|
Print a summary of command line options.
|
|
|
|
|
|
|
|
=back
|
|
|
|
|
|
|
|
=head1 EXIT STATUS
|
|
|
|
|
|
|
|
If B<llvm-bcanalyzer> succeeds, it will exit with 0. Otherwise, if an error
|
|
|
|
occurs, it will exit with a non-zero value, usually 1.
|
|
|
|
|
2004-08-25 02:35:20 +02:00
|
|
|
=head1 SUMMARY OUTPUT DEFINITIONS
|
|
|
|
|
|
|
|
The following items are always printed by llvm-bcanalyzer. They comprize the
|
|
|
|
summary output.
|
|
|
|
|
|
|
|
=over
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
=item B<Bitcode Analysis Of Module>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
This just provides the name of the module for which bitcode analysis is being
|
2004-08-25 02:35:20 +02:00
|
|
|
generated.
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
=item B<Bitcode Version Number>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The bitcode version (not LLVM version) of the file read by the analyzer.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<File Size>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The size, in bytes, of the entire bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Module Bytes>
|
|
|
|
|
|
|
|
The size, in bytes, of the module block. Percentage is relative to File Size.
|
|
|
|
|
|
|
|
=item B<Function Bytes>
|
|
|
|
|
|
|
|
The size, in bytes, of all the function blocks. Percentage is relative to File
|
|
|
|
Size.
|
|
|
|
|
|
|
|
=item B<Global Types Bytes>
|
|
|
|
|
|
|
|
The size, in bytes, of the Global Types Pool. Percentage is relative to File
|
2007-07-09 08:45:18 +02:00
|
|
|
Size. This is the size of the definitions of all types in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Constant Pool Bytes>
|
|
|
|
|
|
|
|
The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
|
|
|
|
Size.
|
|
|
|
|
|
|
|
=item B<Module Globals Bytes>
|
|
|
|
|
|
|
|
Ths size, in bytes, of the Global Variable Definitions and their initializers.
|
|
|
|
Percentage is relative to File Size.
|
|
|
|
|
|
|
|
=item B<Instruction List Bytes>
|
|
|
|
|
|
|
|
The size, in bytes, of all the instruction lists in all the functions.
|
|
|
|
Percentage is relative to File Size. Note that this value is also included in
|
|
|
|
the Function Bytes.
|
|
|
|
|
|
|
|
=item B<Compaction Table Bytes>
|
|
|
|
|
|
|
|
The size, in bytes, of all the compaction tables in all the functions.
|
|
|
|
Percentage is relative to File Size. Note that this value is also included in
|
|
|
|
the Function Bytes.
|
|
|
|
|
2004-12-11 08:16:54 +01:00
|
|
|
=item B<Symbol Table Bytes>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
The size, in bytes, of all the symbol tables in all the functions. Percentage is
|
|
|
|
relative to File Size. Note that this value is also included in the Function
|
|
|
|
Bytes.
|
|
|
|
|
|
|
|
=item B<Dependent Libraries Bytes>
|
|
|
|
|
|
|
|
The size, in bytes, of the list of dependent libraries in the module. Percentage
|
|
|
|
is relative to File Size. Note that this value is also included in the Module
|
|
|
|
Global Bytes.
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
=item B<Number Of Bitcode Blocks>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of blocks of any kind in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Number Of Functions>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of function definitions in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Number Of Types>
|
|
|
|
|
|
|
|
The total number of types defined in the Global Types Pool.
|
|
|
|
|
|
|
|
=item B<Number Of Constants>
|
|
|
|
|
|
|
|
The total number of constants (of any type) defined in the Constant Pool.
|
|
|
|
|
|
|
|
=item B<Number Of Basic Blocks>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of basic blocks defined in all functions in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Number Of Instructions>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of instructions defined in all functions in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Number Of Long Instructions>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of long instructions defined in all functions in the bitcode
|
2004-08-25 02:35:20 +02:00
|
|
|
file. Long instructions are those taking greater than 4 bytes. Typically long
|
|
|
|
instructions are GetElementPtr with several indices, PHI nodes, and calls to
|
|
|
|
functions with large numbers of arguments.
|
|
|
|
|
|
|
|
=item B<Number Of Operands>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of operands used in all instructions in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Number Of Compaction Tables>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of compaction tables in all functions in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Number Of Symbol Tables>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of symbol tables in all functions in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Number Of Dependent Libs>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total number of dependent libraries found in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Total Instruction Size>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The total size of the instructions in all functions in the bitcode file.
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
=item B<Average Instruction Size>
|
|
|
|
|
2007-07-09 08:45:18 +02:00
|
|
|
The average number of bytes per instruction across all functions in the bitcode
|
2004-08-25 02:35:20 +02:00
|
|
|
file. This value is computed by dividing Total Instruction Size by Number Of
|
|
|
|
Instructions.
|
|
|
|
|
|
|
|
=item B<Maximum Type Slot Number>
|
|
|
|
|
|
|
|
The maximum value used for a type's slot number. Larger slot number values take
|
|
|
|
more bytes to encode.
|
|
|
|
|
|
|
|
=item B<Maximum Value Slot Number>
|
|
|
|
|
|
|
|
The maximum value used for a value's slot number. Larger slot number values take
|
|
|
|
more bytes to encode.
|
|
|
|
|
|
|
|
=item B<Bytes Per Value>
|
|
|
|
|
|
|
|
The average size of a Value definition (of any type). This is computed by
|
|
|
|
dividing File Size by the total number of values of any type.
|
|
|
|
|
|
|
|
=item B<Bytes Per Global>
|
|
|
|
|
|
|
|
The average size of a global definition (constants and global variables).
|
|
|
|
|
|
|
|
=item B<Bytes Per Function>
|
|
|
|
|
|
|
|
The average number of bytes per function definition. This is computed by
|
|
|
|
dividing Function Bytes by Number Of Functions.
|
|
|
|
|
|
|
|
=item B<# of VBR 32-bit Integers>
|
|
|
|
|
|
|
|
The total number of 32-bit integers encoded using the Variable Bit Rate
|
|
|
|
encoding scheme.
|
|
|
|
|
|
|
|
=item B<# of VBR 64-bit Integers>
|
|
|
|
|
|
|
|
The total number of 64-bit integers encoded using the Variable Bit Rate encoding
|
|
|
|
scheme.
|
|
|
|
|
|
|
|
=item B<# of VBR Compressed Bytes>
|
|
|
|
|
|
|
|
The total number of bytes consumed by the 32-bit and 64-bit integers that use
|
|
|
|
the Variable Bit Rate encoding scheme.
|
|
|
|
|
|
|
|
=item B<# of VBR Expanded Bytes>
|
|
|
|
|
|
|
|
The total number of bytes that would have been consumed by the 32-bit and 64-bit
|
|
|
|
integers had they not been compressed with the Variable Bit Rage encoding
|
|
|
|
scheme.
|
|
|
|
|
|
|
|
=item B<Bytes Saved With VBR>
|
|
|
|
|
|
|
|
The total number of bytes saved by using the Variable Bit Rate encoding scheme.
|
|
|
|
The percentage is relative to # of VBR Expanded Bytes.
|
|
|
|
|
|
|
|
=back
|
|
|
|
|
|
|
|
=head1 DETAILED OUTPUT DEFINITIONS
|
|
|
|
|
|
|
|
The following definitions occur only if the -nodetails option was not given.
|
|
|
|
The detailed output provides additional information on a per-function basis.
|
|
|
|
|
|
|
|
=over
|
|
|
|
|
|
|
|
=item B<Type>
|
|
|
|
|
|
|
|
The type signature of the function.
|
|
|
|
|
|
|
|
=item B<Byte Size>
|
|
|
|
|
|
|
|
The total number of bytes in the function's block.
|
|
|
|
|
|
|
|
=item B<Basic Blocks>
|
|
|
|
|
|
|
|
The number of basic blocks defined by the function.
|
|
|
|
|
|
|
|
=item B<Instructions>
|
|
|
|
|
|
|
|
The number of instructions defined by the function.
|
|
|
|
|
|
|
|
=item B<Long Instructions>
|
|
|
|
|
|
|
|
The number of instructions using the long instruction format in the function.
|
|
|
|
|
|
|
|
=item B<Operands>
|
|
|
|
|
|
|
|
The number of operands used by all instructions in the function.
|
|
|
|
|
|
|
|
=item B<Instruction Size>
|
|
|
|
|
|
|
|
The number of bytes consumed by instructions in the function.
|
|
|
|
|
|
|
|
=item B<Average Instruction Size>
|
|
|
|
|
|
|
|
The average number of bytes consumed by the instructions in the funtion. This
|
|
|
|
value is computed by dividing Instruction Size by Instructions.
|
|
|
|
|
|
|
|
=item B<Bytes Per Instruction>
|
|
|
|
|
|
|
|
The average number of bytes used by the function per instruction. This value is
|
|
|
|
computed by dividing Byte Size by Instructions. Note that this is not the same
|
|
|
|
as Average Instruction Size. It computes a number relative to the total function
|
|
|
|
size not just the size of the instruction list.
|
|
|
|
|
2004-12-11 08:16:54 +01:00
|
|
|
=item B<Number of VBR 32-bit Integers>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
The total number of 32-bit integers found in this function (for any use).
|
|
|
|
|
2004-12-11 08:16:54 +01:00
|
|
|
=item B<Number of VBR 64-bit Integers>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
The total number of 64-bit integers found in this function (for any use).
|
|
|
|
|
2004-12-11 08:16:54 +01:00
|
|
|
=item B<Number of VBR Compressed Bytes>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
The total number of bytes in this function consumed by the 32-bit and 64-bit
|
|
|
|
integers that use the Variable Bit Rate encoding scheme.
|
|
|
|
|
2004-12-11 08:16:54 +01:00
|
|
|
=item B<Number of VBR Expanded Bytes>
|
2004-08-25 02:35:20 +02:00
|
|
|
|
|
|
|
The total number of bytes in this function that would have been consumed by
|
|
|
|
the 32-bit and 64-bit integers had they not been compressed with the Variable
|
|
|
|
Bit Rate encoding scheme.
|
|
|
|
|
|
|
|
=item B<Bytes Saved With VBR>
|
|
|
|
|
|
|
|
The total number of bytes saved in this function by using the Variable Bit
|
|
|
|
Rate encoding scheme. The percentage is relative to # of VBR Expanded Bytes.
|
|
|
|
|
|
|
|
=back
|
|
|
|
|
2004-07-02 05:44:14 +02:00
|
|
|
=head1 SEE ALSO
|
|
|
|
|
2009-02-28 13:26:34 +01:00
|
|
|
L<llvm-dis|llvm-dis>, L<http://llvm.org/docs/BitCodeFormat.html>
|
2004-07-02 05:44:14 +02:00
|
|
|
|
|
|
|
=head1 AUTHORS
|
|
|
|
|
2006-03-14 06:42:07 +01:00
|
|
|
Maintained by the LLVM Team (L<http://llvm.org>).
|
2004-07-02 05:44:14 +02:00
|
|
|
|
|
|
|
=cut
|