LLVM-OPT-REPORT(1)
β¨ LLVM-OPT-REPORT β¨
okay bestie, gather round π this is the llvm-opt-report page from the LLVM manual set, and she is literally the girl who reads your compiler's diary and turns it into a whole report. no cap.
πΈ NAME πΈ
llvm-opt-report β generate optimization report from YAML π¦
π SYNOPSIS π
llvm-opt-report [options] [input]
π DESCRIPTION π
so llvm-opt-report is a tool that generates an optimization report, and it pulls that report straight out of YAML optimization record files. that's her whole thing, she ate π₯
but listen β you have to make an input YAML optimization record file first before you run llvm-opt-report. she can't report on a vibe that doesn't exist yet, iykyk.
$ clang -c foo.c -o foo.o -O3 -fsave-optimization-record
then you make a report by running the llvm-opt-report command with that YAML optimization record file, foo.opt.yaml, as the input:
$ llvm-opt-report foo.opt.yaml -o foo.lst
and foo.lst? that's the generated optimization report, bestie, she's born β¨
< 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 printed on the left side of the program are telling you what kind of optimization went down π the meanings of the symbols are as follows:
I: the function is inlined.U: the loop is unrolled. the number right after it tells you the unroll factor.V: the loop is vectorized. the numbers right after it tell you the vector length and the interleave factor.
π OPTIONS π
if input is - or you just don't give one at all, llvm-opt-report reads from standard input. otherwise she reads from the filename you specified, periodt.
if the -o option is omitted, then llvm-opt-report sends her output to standard output. and if the -o option specifies -, then the output also goes to standard output. same vibe, either way π«Ά
--helpβ display available options. she'll show you the menu, bestie π--versionβ display the version of this program. so you know exactly which girl you're talking to.--format=<string>β the format of the optimization record file. the argument is one of the following:yamlyaml-strtabbitstream
--no-demangleβ do not demangle function names. leave them exactly as the compiler left them, raw and unbothered π-o=<string>β output file.-r=<string>β root for relative input paths.-sβ do not include vectorization factors, etc. keep it lowkey, minimal, no extra numbers.
π EXIT STATUS π
llvm-opt-report returns 0 on success. otherwise, an error message gets printed to standard error, and the tool returns 1. not the slay we wanted, but she's honest about it π
π§ AUTHOR π§
maintained by the LLVM Team (https://llvm.org/). they're the ones keeping her iconic π
π COPYRIGHT π
2003-2024, LLVM Project
and that's the whole page, babe β this one came to you as version 15, dated 2024-04-14, straight out of the LLVM-OPT-REPORT(1) section of the manual. go make a report, you're the main character now π
π¦ where this page comes from
- ubuntu noble: llvm-16 1:16.0.6-23ubuntu4 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms