llvm-remark-size-diff [options] file_a file_b –parser parser
llvm-remark-size-diff diffs size remarks in two remark files: file_a and file_b.
llvm-remark-size-diff can be used to gain insight into which functions were impacted the most by code generation changes.
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-remark-size-diff handles both YAML and bitstream remarks.
Select the type of input remark parser. Required. * yaml: The tool will parse YAML remarks. * bitstream: The tool will parse bitstream remarks.
Output style. * human: Human-readable textual report. Default option. * json: JSON report.
Pretty-print JSON output. Optional.
If output is not set to JSON, this does nothing.
Output file for the report. Outputs to stdout by default.
The human-readable format for llvm-remark-size-diff is composed of two sections:
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 of OLD and NEW the function_name is present in.
Denotes if function_name has more instructions or fewer instructions in the second file.
llvm-remark-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%)
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": [
...
]
Original paths to remark files.
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
],
}
Instruction counts for the function.
Stack byte counts for the function.
Function JSON does not contain the diffs. Tools consuming JSON output from llvm-remark-size-diff are responsible for computing the diffs separately.
To compute the diffs:
llvm-remark-size-diff returns 0 on success, and a non-zero value otherwise.