1LLVM-OPT-REPORT(1)                   LLVM                   LLVM-OPT-REPORT(1)
2
3
4

NAME

6       llvm-opt-report - generate optimization report from YAML
7

SYNOPSIS

9       llvm-opt-report [options] [input]
10

DESCRIPTION

12       llvm-opt-report  is a tool to generate an optimization report from YAML
13       optimization record files.
14
15       You need to create an input YAML optimization record file  before  run‐
16       ning llvm-opt-report.
17
18          $ clang -c foo.c -o foo.o -O3 -fsave-optimization-record
19
20       Then,  you  create  a report using the llvm-opt-report command with the
21       YAML optimization record file foo.opt.yaml as input.
22
23          $ llvm-opt-report foo.opt.yaml -o foo.lst
24
25       foo.lst is the generated optimization report.
26
27          < foo.c
28           1          | void bar();
29           2          | void foo() { bar(); }
30           3          |
31           4          | void Test(int *res, int *c, int *d, int *p, int n) {
32           5          |   int i;
33           6          |
34           7          | #pragma clang loop vectorize(assume_safety)
35           8     V4,1 |   for (i = 0; i < 1600; i++) {
36           9          |     res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
37          10          |   }
38          11          |
39          12  U16     |   for (i = 0; i < 16; i++) {
40          13          |     res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
41          14          |   }
42          15          |
43          16 I        |   foo();
44          17          |
45          18          |   foo(); bar(); foo();
46             I        |   ^
47             I        |                 ^
48          19          | }
49          20          |
50
51       Symbols printed on the left side of the program indicate what  kind  of
52       optimization  was  performed.   The meanings of the symbols are as fol‐
53       lows:
54
55       • I: The function is inlined.
56
57       • U: The loop is unrolled. The following number  indicates  the  unroll
58         factor.
59
60       • V:  The loop is vectorized. The following numbers indicate the vector
61         length and the interleave factor.
62

OPTIONS

64       If input is "-" or omitted, llvm-opt-report reads from standard  input.
65       Otherwise, it will read from the specified filename.
66
67       If  the -o option is omitted, then llvm-opt-report will send its output
68       to standard output.  If the -o option specifies "-",  then  the  output
69       will also be sent to standard output.
70
71       --help Display available options.
72
73       --version
74              Display the version of this program.
75
76       --format=<string>
77              The format of the optimization record file.  The Argument is one
78              of the following:
79
80              • yaml
81
82              • yaml-strtab
83
84              • bitstream
85
86       --no-demangle
87              Do not demangle function names.
88
89       -o=<string>
90              Output file.
91
92       -r=<string>
93              Root for relative input paths.
94
95       -s     Do not include vectorization factors, etc.
96

EXIT STATUS

98       llvm-opt-report returns 0 on success. Otherwise, an  error  message  is
99       printed to standard error, and the tool returns 1.
100

AUTHOR

102       Maintained by the LLVM Team (https://llvm.org/).
103
105       2003-2023, LLVM Project
106
107
108
109
11016                                2023-08-24                LLVM-OPT-REPORT(1)
Impressum