LLVM-REMARKUTIL(1) | LLVM | LLVM-REMARKUTIL(1) |
llvm-remarkutil - Remark utility
llvm-remarkutil [subcommmand] [options]
Utility for displaying information from, and converting between different remark formats.
USAGE: llvm-remarkutil bitstream2yaml <input file> -o <output file>
Takes a bitstream remark file as input, and reserializes that file as YAML.
USAGE: llvm-remarkutil yaml2bitstream <input file> -o <output file>
Takes a YAML remark file as input, and reserializes that file in the bitstream format.
USAGE: llvm-remarkutil instruction-count <input file> –parser=<bitstream|yaml> [–use-debug-loc] -o <output file>
Outputs instruction count remarks for every function. Instruction count remarks encode the number of instructions in a function at assembly printing time.
Instruction count remarks require asm-printer remarks.
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.
Source,Function,InstructionCount path:line:column,foo,3
USAGE: llvm-remarkutil annotation-count <input file> –parser=<bitstream|yaml> –annotation-type=<type> [–use-debug-loc] -o <output file>
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.
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.
Source,Function,Count path:line:column,foo,3
USAGE: llvm-remarkutil count [options] <input file>
llvm-remarkutil count counts remarks 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.
USAGE: llvm-remarkutil size-diff [options] file_a file_b –parser parser
llvm-remarkutil size-diff diffs size remarks 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.
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 and bitstream remarks.
Select the type of input remark parser. Required.
If output is not set to JSON, this does nothing.
The human-readable format for llvm-remarkutil 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-remarkutil size-diff will emit a line like below:
(++|--|==) (>|<) function_name, N instrs, M stack B
A breakdown of the format is below:
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%)
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": [ ... ]
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 ], }
Function JSON does not contain the diffs. Tools consuming JSON output from llvm-remarkutil size-diff are responsible for computing the diffs separately.
To compute the diffs:
llvm-remarkutil size-diff returns 0 on success, and a non-zero value otherwise.
Maintained by the LLVM Team (https://llvm.org/).
2003-2024, LLVM Project
2024-12-05 | 15 |