LLVM-OPT-REPORT(1)

πŸ’… NAME πŸ’…

llvm-opt-report β€” okay so this is the girl that generates an optimization report from YAML. That's it, that's her whole job, and she does it flawlessly. ✨

This page is from the LLVM manual, bestie β€” write that down.


πŸŽ€ SYNOPSIS πŸŽ€

llvm-opt-report [options] [input]

πŸ¦‹ DESCRIPTION πŸ¦‹

llvm-opt-report is a tool that generates an optimization report out of YAML optimization record files. No cap, that's literally the assignment.

But here's the thing, bestie β€” you gotta create an input YAML optimization record file before you run llvm-opt-report. It's not gonna manifest one out of the void for you. πŸ™ˆ

That YAML file is giving all the tea: it provides information on the execution time, memory usage, and other details of each optimization pass. So useful, honestly.

$ 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. Iconic two-step process:

$ llvm-opt-report foo.opt.yaml -o foo.lst

And foo.lst is the generated optimization report. Slay. Here's what it looks like in all its glory:

< 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          |

So those symbols chillin' on the left side of the program? They tell you what kind of optimization was performed. The meanings, decoded for you bestie:

  • 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. She's not bugging β€” she's evolving. πŸ’€

🌸 OPTIONS 🌸

First, the input/output ground rules, because this part matters:

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. Very "go with the flow" of her, honestly.

Now the actual flags, one by one, no skipping:

  • --help β€” Display available options. Go off, king, learn thyself.
  • --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. Sometimes you want the raw, crunchy, mangled truth. Respect.
  • -o=<string> β€” Output file.
  • -r=<string> β€” Root for relative input paths.
  • -s β€” Do not include vectorization factors, etc. Minimalist era. πŸŽ€

⭐ EXIT STATUS ⭐

llvm-opt-report returns 0 on success. Otherwise, an error message is printed to standard error, and the tool returns 1. So if you see a 1, something's not slaying β€” check your standard error, bestie. 😭


πŸ’œ Author πŸ’œ

Maintained by the LLVM Team (https://llvm.org/). They're the main characters of this whole story, fr fr.

2003-2026, LLVM Project


and that's the whole page, bestie β€” version 21, dated 2026-05-15, brought to you by LLVM-OPT-REPORT(1). go forth and optimize, ily πŸ«ΆπŸ’–

πŸ“¦ where this page comes from