.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "LLVM-OPT-REPORT" "1" "2023-10-16" "15" "LLVM" .SH NAME llvm-opt-report \- generate optimization report from YAML .SH SYNOPSIS .sp \fBllvm\-opt\-report\fP [\fIoptions\fP] [input] .SH DESCRIPTION .sp \fBllvm\-opt\-report\fP is a tool to generate an optimization report from YAML optimization record files. .sp You need to create an input YAML optimization record file before running \fBllvm\-opt\-report\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ clang \-c foo.c \-o foo.o \-O3 \-fsave\-optimization\-record .ft P .fi .UNINDENT .UNINDENT .sp Then, you create a report using the \fBllvm\-opt\-report\fP command with the YAML optimization record file \fBfoo.opt.yaml\fP as input. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ llvm\-opt\-report foo.opt.yaml \-o foo.lst .ft P .fi .UNINDENT .UNINDENT .sp foo.lst is the generated optimization report. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C < 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 | .ft P .fi .UNINDENT .UNINDENT .sp Symbols printed on the left side of the program indicate what kind of optimization was performed. The meanings of the symbols are as follows: .INDENT 0.0 .IP \(bu 2 I: The function is inlined. .IP \(bu 2 U: The loop is unrolled. The following number indicates the unroll factor. .IP \(bu 2 V: The loop is vectorized. The following numbers indicate the vector length and the interleave factor. .UNINDENT .SH OPTIONS .sp If \fBinput\fP is “\fB\-\fP” or omitted, \fBllvm\-opt\-report\fP reads from standard input. Otherwise, it will read from the specified filename. .sp If the \fI\%\-o\fP option is omitted, then \fBllvm\-opt\-report\fP will send its output to standard output. If the \fI\%\-o\fP option specifies “\fB\-\fP”, then the output will also be sent to standard output. .INDENT 0.0 .TP .B \-\-help Display available options. .UNINDENT .INDENT 0.0 .TP .B \-\-version Display the version of this program. .UNINDENT .INDENT 0.0 .TP .B \-\-format= The format of the optimization record file. The Argument is one of the following: .INDENT 7.0 .IP \(bu 2 yaml .IP \(bu 2 yaml\-strtab .IP \(bu 2 bitstream .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \-\-no\-demangle Do not demangle function names. .UNINDENT .INDENT 0.0 .TP .B \-o= Output file. .UNINDENT .INDENT 0.0 .TP .B \-r= Root for relative input paths. .UNINDENT .INDENT 0.0 .TP .B \-s Do not include vectorization factors, etc. .UNINDENT .SH EXIT STATUS .sp \fBllvm\-opt\-report\fP returns 0 on success. Otherwise, an error message is printed to standard error, and the tool returns 1. .SH AUTHOR Maintained by the LLVM Team (https://llvm.org/). .SH COPYRIGHT 2003-2023, LLVM Project .\" Generated by docutils manpage writer. .