LLVM-OPT-REPORT(1)

πŸ’– LLVM-OPT-REPORT β€” the NAME section, bestie πŸ’–

okay so like, this is llvm-opt-report from the LLVM manual, and what it does is generate an optimization report from YAML. that's the whole vibe. πŸŽ€

✨ SYNOPSIS ✨

llvm-opt-report [options] [input]

πŸ¦‹ DESCRIPTION πŸ¦‹

so llvm-opt-report is a tool that generates an optimization report from YAML optimization record files. that's literally it, and it ate. πŸ’…

heads up tho β€” you gotta create an input YAML optimization record file before you run llvm-opt-report. no input file, no report, no slay. 🫢

what you get out of it is info on the execution time, memory usage, and other deets of each optimization pass. every single one. periodt.

first step, bestie β€” make the record file:

$ 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

and foo.lst is the generated optimization report. iconic. ✨

like, here's what it's giving:

< 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 little symbols on the left 🧚

the symbols printed on the left side of the program tell you what kind of optimization was performed. the meanings are as follows, iykyk:

  • 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. so not a glitch, bestie β€” that's character development. 😭

🌈 OPTIONS 🌈

okay so input handling first, bc it's kinda important:

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. fr fr. πŸ’œ

  • --help β€” display available options. classic.
  • --version β€” display the version of this program. πŸ‘‘
  • --format=<string> β€” the format of the optimization record file. the argument is one of the following:
    • yaml
    • bitstream
  • --no-demangle β€” do not demangle function names. leave 'em crunchy. πŸ’€
  • -o=<string> β€” output file.
  • -r=<string> β€” root for relative input paths.
  • -s β€” do not include vectorization factors, etc. keep it lowkey. πŸ™ˆ

🌸 EXIT STATUS 🌸

llvm-opt-report returns 0 on success. otherwise, an error message is printed to standard error, and the tool returns 1. so like, if you see a 1, something went sideways bestie, go read the error. 😀


πŸ‘‘ Author πŸ‘‘

maintained by the LLVM Team (https://llvm.org/). they're the main characters here, honestly. 🫢

2003-2026, LLVM Project. all the rights, all the love. πŸ’–


and that's the whole page, bestie!! slay ✨ source/version: this is the LLVM project's page, revision 23, dated 2026-10-20 β€” go forth and optimize, you gorgeous genius, mwah πŸ’‹πŸ¦‹

πŸ“¦ where this page comes from
  • arch rolling: llvm 23.1.4-1 Β· Apache-2.0 WITH LLVM-exception
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms