LLVM-BCANALYZER(1)
๐ llvm-bcanalyzer โ the LLVM bitcode analyzer, bestie edition โจ
okay so real talk: this is the llvm-bcanalyzer page from the LLVM manual, and I'm gonna walk you through it like we're texting at 2am ๐ซถ
๐ธ NAME ๐ธ
llvm-bcanalyzer โ LLVM bitcode analyzer. that's it, that's the whole vibe ๐
โจ SYNOPSIS โจ
llvm-bcanalyzer [options] [filename]
literally just that. iconic. no cap ๐
๐ฆ DESCRIPTION ๐ฆ
okay so the llvm-bcanalyzer command is this cute little utility for analyzing bitcode files. it reads a bitcode file โ like, one you'd generate with the llvm-as tool โ and then it produces a statistical report on what's inside that bitcode file. so you get the receipts on your bytes โจ
the tool can also dump a low level but human readable version of the bitcode file. so like, both the stats and the actual guts, your choice ๐
now, important vibe check: this tool is probably not of much interest or utility except for those working directly with the bitcode file format. most LLVM users can just ignore this tool. i said what i said โ it's a niche icon, and that's okay ๐ฅ
if filename is omitted or is -, then llvm-bcanalyzer reads its input from standard input. this is useful for combining the tool into a pipeline, which is honestly so slay of it ๐. output is written to the standard output.
๐ OPTIONS ๐
--dumpโ causesllvm-bcanalyzerto dump the bitcode in a human readable format. this format is significantly different from LLVM assembly and provides details about the encoding of the bitcode file. it's giving "behind the scenes director's cut" ๐ฌ--helpโ print a summary of command line options. the classic, the beloved, the "help me help you" ๐ซถ
๐ง EXIT STATUS ๐ง
if llvm-bcanalyzer succeeds, it will exit with 0. otherwise, if an error occurs, it will exit with a non-zero value, usually 1. so 0 = slay, anything else = ๐ญ
๐ SUMMARY OUTPUT DEFINITIONS ๐
the following items are always printed by llvm-bcanalyzer. they comprize the summary output. (yes, "comprize" โ that's what the page says, we keep the facts, periodt ๐
)
๐ธ Bitcode Analysis Of Module
this just provides the name of the module for which bitcode analysis is being generated. name tag energy ๐ท๏ธ
๐ธ Bitcode Version Number
the bitcode version (not LLVM version) of the file read by the analyzer. important distinction, bestie โ bitcode version, not LLVM version ๐
๐ธ File Size
the size, in bytes, of the entire bitcode file. the whole thing, head to toe ๐
๐ธ Module Bytes
the size, in bytes, of the module block. percentage is relative to File Size.
๐ธ Function Bytes
the size, in bytes, of all the function blocks. percentage is relative to File Size.
๐ธ Global Types Bytes
the size, in bytes, of the Global Types Pool. percentage is relative to File Size. this is the size of the definitions of all types in the bitcode file. so basically the type lore ๐
๐ธ Constant Pool Bytes
the size, in bytes, of the Constant Pool Blocks. percentage is relative to File Size. (the original page runs these two together in one line, and we're not about to separate them ๐)
๐ธ Module Globals Bytes
Ths size, in bytes, of the Global Variable Definitions and their initializers. percentage is relative to File Size. ("Ths" โ keeping the typo, it's canon now ๐)
๐ธ 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. so it's double-dipping in the accounting, and we respect that ๐ซก
๐ธ 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.
๐ธ Symbol Table Bytes
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.
๐ธ 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.
๐ธ Number Of Bitcode Blocks
the total number of blocks of any kind in the bitcode file. any kind!! no discrimination ๐
๐ธ Number Of Functions
the total number of function definitions in the bitcode file.
๐ธ Number Of Types
the total number of types defined in the Global Types Pool.
๐ธ Number Of Constants
the total number of constants (of any type) defined in the Constant Pool.
๐ธ Number Of Basic Blocks
the total number of basic blocks defined in all functions in the bitcode file.
๐ธ Number Of Instructions
the total number of instructions defined in all functions in the bitcode file.
๐ธ Number Of Long Instructions
the total number of long instructions defined in all functions in the bitcode 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. big instruction energy ๐ฅ
๐ธ Number Of Operands
the total number of operands used in all instructions in the bitcode file.
๐ธ Number Of Compaction Tables
the total number of compaction tables in all functions in the bitcode file.
๐ธ Number Of Symbol Tables
the total number of symbol tables in all functions in the bitcode file.
๐ธ Number Of Dependent Libs
the total number of dependent libraries found in the bitcode file.
๐ธ Total Instruction Size
the total size of the instructions in all functions in the bitcode file.
๐ธ Average Instruction Size
the average number of bytes per instruction across all functions in the bitcode file. this value is computed by dividing Total Instruction Size by Number Of Instructions. math girlies rise ๐งฎ
๐ธ Maximum Type Slot Number
the maximum value used for a type's slot number. larger slot number values take more bytes to encode. so like, small numbers are lowkey cheaper ๐ฑ
๐ธ Maximum Value Slot Number
the maximum value used for a value's slot number. larger slot number values take more bytes to encode.
๐ธ 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.
๐ธ Bytes Per Global
the average size of a global definition (constants and global variables).
๐ธ Bytes Per Function
the average number of bytes per function definition. this is computed by dividing Function Bytes by Number Of Functions.
๐ธ # of VBR 32-bit Integers
the total number of 32-bit integers encoded using the Variable Bit Rate encoding scheme.
๐ธ # of VBR 64-bit Integers
the total number of 64-bit integers encoded using the Variable Bit Rate encoding scheme.
๐ธ # 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.
๐ธ # 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. ("Bit Rage" โ yes, rage. it's in the original. it's giving typo but make it fashion ๐)
๐ธ 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.
๐ 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. per-function!! the main character breakdown ๐
๐ฆ Type
the type signature of the function.
๐ฆ Byte Size
the total number of bytes in the function's block.
๐ฆ Basic Blocks
the number of basic blocks defined by the function.
๐ฆ Instructions
the number of instructions defined by the function.
๐ฆ Long Instructions
the number of instructions using the long instruction format in the function.
๐ฆ Operands
the number of operands used by all instructions in the function.
๐ฆ Instruction Size
the number of bytes consumed by instructions in the function.
๐ฆ Average Instruction Size
the average number of bytes consumed by the instructions in the function. this value is computed by dividing Instruction Size by Instructions.
๐ฆ 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. two different things, bestie, don't get it twisted ๐ซถ
๐ฆ Number of VBR 32-bit Integers
the total number of 32-bit integers found in this function (for any use).
๐ฆ Number of VBR 64-bit Integers
the total number of 64-bit integers found in this function (for any use).
๐ฆ Number of VBR Compressed Bytes
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.
๐ฆ Number of VBR Expanded Bytes
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.
๐ฆ 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.
๐ SEE ALSO ๐
llvm-dis(1)/BitCodeFormat
go read those next, iykyk ๐๐
โญ AUTHOR โญ
maintained by the LLVM Team (https://llvm.org/). love them for it ๐ซถ
๐ COPYRIGHT ๐
2003-2023, LLVM Project
and that's the whole page, bestie! ๐ธ this was LLVM-BCANALYZER(1) from the LLVM manual, dated 2023-07-14, page 15 โ mwah, go analyze some bitcode, you absolute icon ๐
โจ๐ฆ
๐ฆ where this page comes from
- ubuntu jammy: llvm-15 1:15.0.7-0ubuntu0.22.04.3 ยท APACHE-2-LLVM-EXCEPTIONS
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms