LLVM-REMARKUTIL(1)
๐ LLVM-REMARKUTIL(1) ๐
okay so bestie, welcome to the llvm-remarkutil manual page โ this is the LLVM project's little remark-handling Swiss Army knife, and yes, it's giving main character energy. ๐
โจ NAME โจ
llvm-remarkutil โ the Remark utility. that's it. that's the name. short, iconic, to the point. ๐
โจ SYNOPSIS โจ
llvm-remarkutil [subcommmand] [options]
(yes, subcommmand has three m's in the original โ I don't make the rules, I just report them faithfully ๐)
โจ DESCRIPTION โจ
So what does this thing do? It's a utility for displaying information from, and converting between, different remark formats โ you know, the ones documented over at <https://llvm.org/docs/Remarks.html>. lowkey essential if you're living that remark life. ๐ฆ
โจ SUBCOMMANDS โจ
here's the squad, and they all slay in their own way:
bitstream2yamlโ reserialize bitstream remarks to YAML. โจyaml2bitstreamโ reserialize YAML remarks to bitstream. โจinstruction-countโ output function instruction counts. โจannotation-countโ output remark type count from annotation remarks. โจsize-diffโ compute diff in size remarks. โจ
๐ bitstream2yaml ๐
USAGE: llvm-remarkutil bitstream2yaml <input file> -o <output file>
Summary
Takes a bitstream remark file as input, and reserializes that file as YAML. glow-up in progress. ๐
๐ yaml2bitstream ๐
USAGE: llvm-remarkutil yaml2bitstream <input file> -o <output file>
Summary
Takes a YAML remark file as input, and reserializes that file in the bitstream format. the reverse glow-up. ๐ซถ
๐ instruction-count ๐
USAGE: llvm-remarkutil instruction-count <input file>
--parser=<bitstream|yaml> [--use-debug-loc] -o <output file>
Summary
Outputs instruction count remarks for every function. Instruction count remarks encode the number of instructions in a function at assembly printing time. ngl that's kind of a flex. ๐ช
Instruction count remarks require asm-printer remarks. (no asm-printer remarks, no counts โ that's just how it is, bestie ๐ญ)
The CSV format is as follows:
Function,InstructionCount
foo,123
if --use-debug-loc is passed then the CSV will include the source path, line number and column. fancy. ๐ธ
Source,Function,InstructionCount
path:line:column,foo,3
๐ annotation-count ๐
USAGE: llvm-remarkutil annotation-count <input file>
--parser=<bitstream|yaml> --annotation-type=<type> [--use-debug-loc] -o
<output file>
Summary
Outputs a count for annotation-type <type> remark for every function. The count expresses the number of remark checks inserted at the function. ๐ฅ
Annotation count remarks require AnnotationRemarksPass remarks.
The CSV format is as follows:
Function,Count
foo,123
if --use-debug-loc is passed then the CSV will include the source path, line number and column. yes, again. consistency queen. ๐
Source,Function,Count
path:line:column,foo,3
๐ count ๐
..program:: llvm-remarkutil count โ yes I'm including this directive thing verbatim, don't @ me ๐
USAGE: llvm-remarkutil count [options] <input file>
Summary
llvm-remarkutil count counts remarks (<https://llvm.org/docs/Remarks.html>) based on specified properties. By default the tool counts remarks based on how many occur in a source file or function or total for the generated remark file. The tool also supports collecting count based on specific remark arguments. The specified arguments should have an integer value to be able to report a count. โจ
The tool contains utilities to filter the remark count based on remark name, pass name, argument value and remark type.
OPTIONS
--parser=<yaml|bitstream>โ Select the type of input remark parser. Required. (you literally cannot skip this one bestie ๐)yaml: The tool will parse YAML remarks.bitstream: The tool will parse bitstream remarks.
--count-by<value>โ Select option to collect remarks by.remark-name: count how many individual remarks exist.arg: count remarks based on specified arguments passed by--(r)args. The argument value must be a number. ๐ข
--group-by=<value>โ group count of remarks by property.source: Count will be collected per source path. Remarks with no debug location will not be counted.function: Count is collected per function.function-with-loc: Count is collected per function per source. Remarks with no debug location will not be counted.Total: Report a count for the provided remark file.
--args[=arguments]โ Ifcount-byis set toargthis flag can be used to collect from specified remark arguments represented as a comma separated string.
The arguments must have a numeral value to be able to count remarks by. (no numbers, no count, periodt โ)
--rargs[=arguments]โ Ifcount-byis set toargthis flag can be used to collect from specified remark arguments using regular expression.
The arguments must have a numeral value to be able to count remarks by. (same deal ๐ซถ)
--pass-name[=<string>]โ Filter count by pass name.--rpass-name[=<string>]โ Filter count by pass name using regular expressions. ๐ง--remark-name[=<string>]โ Filter count by remark name.--rremark-name[=<string>]โ Filter count by remark name using regular expressions. ๐ง--filter-arg-by[=<string>]โ Filter count by argument value.--rfilter-arg-by[=<string>]โ Filter count by argument value using regular expressions. ๐ง--remark-type=<value>โ Filter remarks by type with the following options:unknownpassedmissedanalysisanalysis-fp-commuteanalysis-aliasingfailure
๐ size-diff ๐
USAGE: llvm-remarkutil size-diff [options] file_a file_b --parser parser
Summary
llvm-remarkutil size-diff diffs size remarks (<https://llvm.org/docs/Remarks.html>) in two remark files: file_a and file_b. ๐ฆ
llvm-remarkutil size-diff can be used to gain insight into which functions were impacted the most by code generation changes. the way this finds the drama in your functions... obsessed.
In most common use-cases file_a and file_b will be remarks output by compiling a fixed source with differing compilers or differing optimization settings. ๐
llvm-remarkutil size-diff handles both YAML <https://llvm.org/docs/Remarks.html#yaml-remarks> and bitstream <https://llvm.org/docs/Remarks.html#llvm-bitstream-remarks> remarks. versatile icon.
โจ OPTIONS โจ
--parser=<yaml|bitstream>โ Select the type of input remark parser. Required.yaml: The tool will parse YAML remarks.bitstream: The tool will parse bitstream remarks.
--report-style=<human|json>โ Output style.human: Human-readable textual report. Default option.json: JSON report.
--prettyโ Pretty-print JSON output. Optional.
If output is not set to JSON, this does nothing. (literally nothing. it's just sitting there being cute ๐)
-o=<file>โ Output file for the report. Outputs tostdoutby default.
โจ HUMAN-READABLE OUTPUT โจ
The human-readable format for llvm-remarkutil size-diff is composed of two sections:
- Per-function changes. ๐
- A high-level summary of all changes. ๐
๐ Changed Function Section ๐
Suppose you are comparing two remark files OLD and NEW.
For each function with a changed instruction count in OLD and NEW, llvm-remarkutil size-diff will emit a line like below:
(++|--|==) (>|<) function_name, N instrs, M stack B
A breakdown of the format is below:
(++|--|==)โ Which of OLD and NEW thefunction_nameis present in.++: Only in NEW. ("Added") โจ--: Only in OLD. ("Removed") ๐==: In both. ๐ซถ
(>|<)โ Denotes iffunction_namehas more instructions or fewer instructions in the second file.>: More instructions in second file than first file. ๐<: Fewer instructions in second file than in first file. ๐
function_nameโ The name of the changed function.N instrsโ Second file instruction count - first file instruction count. ๐ขM stack Bโ Second file stack byte count - first file stack byte count. ๐งฎ
๐ Summary Section ๐
llvm-remarkutil size-diff will output a high-level summary after printing all changed functions.
instruction count: N (inst_pct_change%)
stack byte usage: M (sb_pct_change%)
Nโ Sum of all instruction count changes between the second and first file.inst_pct_change%โ Percent increase or decrease in instruction count between the second and first file.Mโ Sum of all stack byte count changes between the second and first file.sb_pct_change%โ Percent increase or decrease in stack byte usage between the second and first file.
โจ JSON OUTPUT โจ
๐ฆ High-Level view ๐ฆ
Suppose we are comparing two files, OLD and NEW.
llvm-remarkutil size-diff will output JSON as follows.
"Files": [
"A": "path/to/OLD",
"B": "path/to/NEW"
]
"InBoth": [
...
],
"OnlyInA": [
...
],
"OnlyInB": [
...
]
Filesโ Original paths to remark files.A: Path to the first file.B: Path to the second file.
InBothโ Functions present in both files.OnlyInAโ Functions only present in the first file.OnlyInBโ Functions only present in the second file.
๐ฆ Function JSON ๐ฆ
The InBoth, OnlyInA, and OnlyInB sections contain size information for each function in the input remark files.
{
"FunctionName" : "function_name"
"InstCount": [
INST_COUNT_A,
INST_COUNT_B
],
"StackSize": [
STACK_BYTES_A,
STACK_BYTES_B
],
}
FunctionNameโ Name of the function.InstCountโ Instruction counts for the function.INST_COUNT_A: Instruction count in OLD.INST_COUNT_B: Instruction count in NEW.
StackSizeโ Stack byte counts for the function.STACK_BYTES_A: Stack bytes in OLD.STACK_BYTES_B: Stack bytes in NEW.
๐ฆ Computing Diffs From Function JSON ๐ฆ
Function JSON does not contain the diffs. Tools consuming JSON output from llvm-remarkutil size-diff are responsible for computing the diffs separately. (yes bestie, you gotta do the math yourself, I believe in you ๐ซถ)
To compute the diffs:
- Instruction count diff:
INST_COUNT_B - INST_COUNT_A - Stack byte count diff:
STACK_BYTES_B - STACK_BYTES_A
โจ EXIT STATUS โจ
llvm-remarkutil size-diff returns 0 on success, and a non-zero value otherwise. clean, simple, no notes. โ
โจ Author โจ
Maintained by the LLVM Team (<https://llvm.org/>). shoutout to the maintainers, they're carrying. ๐
โจ Copyright โจ
2003-2026, LLVM Project. all rights reserved, all vibes reserved. ๐
okay that's the whole page bestie, you're officially a remark-util expert now โ go forth and diff those size remarks ๐ธ๐ โจ
LLVM 15 โข 2026-09-09 โข LLVM-REMARKUTIL(1) โ mwah, thanks for reading, ily, bye! ๐๐ฆ๐
๐ฆ where this page comes from
- ubuntu stonking: llvm-18 1:18.1.8-20ubuntu11 ยท 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