LLVM-REMARK-SIZE-DIFF(1)
π LLVM-REMARK-SIZE-DIFF π
okay so bestie, welcome to the llvm-remark-size-diff page β it's part of the LLVM manual set (yes, that LLVM, the big one π), and it's genuinely one of the most underrated little tools in the whole box. let's get into it π«Ά
β¨ NAME β¨
llvm-remark-size-diff β diff size remarks, that's the whole vibe π
πΈ SYNOPSIS πΈ
llvm-remark-size-diff [options] file_a file_b --parser parser
π¦ DESCRIPTION π¦
So like. llvm-remark-size-diff diffs size remarks in two remark files: file_a and file_b. that's it, that's the job, and it ate π
You use it to gain insight into which functions were impacted the most by code generation changes. literally a glow-up detector for your functions π₯
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. same source, different compiler, and this tool tells you who got bigger and who got smaller. main character energy fr fr β¨
llvm-remark-size-diff handles both YAML and bitstream remarks. both! versatile icon π
β OPTIONS β
--parser=<yaml|bitstream>β Select the type of input remark parser. Required. ngl you literally cannot skip this one πyaml: The tool will parse YAML remarks.bitstream: The tool will parse bitstream remarks.
--report-style=<human|json>β Output style. pick your aesthetic π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. like, it just sits there being cute and useless π«
-o=<file>β Output file for the report. Outputs to stdout by default.
π HUMAN-READABLE OUTPUT π
The human-readable format for llvm-remark-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-remark-size-diff will emit a line like below:
(++|--|==) (>|<) function_name, N instrs, M stack B
A breakdown of the format is below:
(++|--|==)β Which ofOLDandNEWthefunction_nameis present in.++: Only inNEW. ("Added") π--: Only inOLD. ("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-remark-size-diff will output a high-level summary after printing all changed functions. the grand finale, the recap, the "so how did we do" moment π
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-remark-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 inOLD.INST_COUNT_B: Instruction count inNEW.
StackSizeβ Stack byte counts for the function.STACK_BYTES_A: Stack bytes inOLD.STACK_BYTES_B: Stack bytes inNEW.
π¦ Computing Diffs From Function JSON π¦
Function JSON does not contain the diffs. Tools consuming JSON output from llvm-remark-size-diff are responsible for computing the diffs separately. yeah. the math is on you bestie, we just hand you the numbers π
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-remark-size-diff returns 0 on success, and a non-zero value otherwise. slay when it works, π when it doesn't.
π AUTHOR π
Maintained by the LLVM Team (https://llvm.org/). icons, honestly π«Ά
π COPYRIGHT π
2003-2023, LLVM Project
and that's the whole page bestie, you're officially a size-remark scholar now, no cap πβ¨ this was LLVM-REMARK-SIZE-DIFF(1), manual page 15, dated 2023-01-14, straight from the LLVM corner of the universe β go diff some remarks and have the best day ππ¦πΈ periodt.
π¦ where this page comes from
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm15 15.0.7-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms