LLVM-OPT-REPORT(1)
π NAME π
Hey bestie! π This is the LLVM-OPT-REPORT(1) manual page for llvm-opt-report, straight from the LLVM manual, section 1 β and its whole job is to generate optimization report from YAML β¨
β¨ SYNOPSIS β¨
llvm-opt-report [options] [input]
π¦ DESCRIPTION π¦
Okay so llvm-opt-report is the tool that generates an optimization report from YAML optimization record files. No cap, thatβs the vibe π
You need to create an input YAML optimization record file before running llvm-opt-report, bestie. It provides information on the execution time, memory usage, and other details of each optimization pass. Iconic info, honestly π«Ά
First, make the optimization record with clang:
$ clang -c foo.c -o foo.o -O3 -fsave-optimization-record
Then you create a report using the llvm-opt-report command with the YAML optimization record file foo.opt.yaml as input:
$ llvm-opt-report foo.opt.yaml -o foo.lst
foo.lst is the generated optimization report. And it looks like this:
< foo.c
1 | void bar();
2 | void foo() { bar(); }
3 |
4 | void Test(int *res, int *c, int *d, int *p, int n) {
5 | int i;
6 |
7 | #pragma clang loop vectorize(assume_safety)
8 V4,1 | for (i = 0; i < 1600; i++) {
9 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
10 | }
11 |
12 U16 | for (i = 0; i < 16; i++) {
13 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
14 | }
15 |
16 I | foo();
17 |
18 | foo(); bar(); foo();
I | ^
I | ^
19 | }
20 |
The symbols printed on the left side of the program indicate what kind of optimization was performed. The meanings of the symbols are as follows:
Iβ the function is inlined β¨Uβ the loop is unrolled. The following number indicates the unroll factor π₯Vβ the loop is vectorized. The following numbers indicate the vector length and the interleave factor π
NOTE: If a specific line of code is output twice, it means that the same optimization pass was applied to that line of code twice, and the pass was able to further optimize the code on the second iteration. Bestie, thatβs a glow-up on the second pass πβ¨
π OPTIONS π
If input is - or omitted, llvm-opt-report reads from standard input. Otherwise, it will read from the specified filename.
If the -o option is omitted, then llvm-opt-report will send its output to standard output. If the -o option specifies -, then the output will also be sent to standard output.
--helpβ display available options π--versionβ display the version of this program π--format=<string>β the format of the optimization record file. The argument is one of the following:yamlbitstream
--no-demangleβ do not demangle function names π-o=<string>β output file π-r=<string>β root for relative input paths π-sβ do not include vectorization factors, etc. π
π₯ EXIT STATUS π₯
llvm-opt-report returns 0 on success. Otherwise, an error message is printed to standard error, and the tool returns 1.
πΈ AUTHOR πΈ
Maintained by the LLVM Team (https://llvm.org/). Periodt π
π COPYRIGHT π
2003-2026, LLVM Project
Catch you later, bestie! π
This was LLVM-OPT-REPORT(1) from LLVM source/version 23, dated 2026-10-06 π«Άβ¨
π¦ where this page comes from
- centos-stream 9: llvm 23.1.3-1.el9 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- centos-stream 9: llvm 23.1.3-1.el9 Β· Apache-2.0 WITH LLVM-exception OR NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms