4bf67a49c2547561364e85dd435699bc0a79190e
[oota-llvm.git] / docs / CommandGuide / opt.html
1 <html>
2 <title>LLVM: opt tool</title>
3
4 <body bgcolor=white>
5
6 <center><h1>LLVM: <tt>opt</tt> tool</h1></center>
7 <HR>
8
9 <h3>NAME</h3>
10 <tt>opt</tt>
11
12 <h3>SYNOPSIS</h3>
13 <tt>opt [options] [filename]</tt>
14
15 <h3>DESCRIPTION</h3>
16
17 The <tt>opt</tt> command is the modular LLVM optimizer.  It takes LLVM bytecode
18 as input, runs the specified optimizations on it, and then outputs the optimized
19 LLVM bytecode.
20 <p>
21
22 The optimizations available via <tt>opt</tt> depend upon what libraries were
23 linked into it as well as any additional libraries that have been loaded with
24 the <tt>-load</tt> option.  Use the <tt>-help</tt> option to determine what
25 optimizations you can use.
26 <p>
27
28 If no filename is specified on the command line, <tt>opt</tt> reads its input
29 from standard input.
30 <p>
31
32 If an output filename is not specified with the <tt>-o</tt> option, <tt>opt</tt>
33 writes its output to the standard output.
34
35
36 <h3>OPTIONS</h3>
37
38 <ul>
39         <li> -f
40         <br>
41         Force overwrite.  Normally, <tt>opt</tt> will refuse to overwrite an
42         output file that already exists.  With this option, <tt>opt</tt> will
43         overwrite the output file and replace it with new bytecode.
44         <p>
45
46         <li> -help
47         <br>
48         Print a summary of command line options.
49         <p>
50
51         <li> -o &lt;filename&gt;
52         <br>
53         Specify the output filename.
54         <p>
55
56         <li> -dsa-track-integers
57         <br>
58         Track integers as potential pointers.
59         <p>
60
61         <li> -profile-info-file &lt;filename&gt;
62         <br>
63         Specify the name of the file loaded by the -profile-loader option.
64         <p>
65
66         <li> -stats
67         <br>
68         Print statistics.
69         <p>
70
71         <li> -time-passes
72         <br>
73         Record the amount of time needed for each pass and print it to standard
74         error.
75         <p>
76
77         <li> -debug
78         <br>
79         If this is a debug build, this option will enable debug printouts from
80         passes which use the <tt>DEBUG</tt> macro.  See the <a
81         href="../ProgrammersManual.html#DEBUG">Programmer's Manual</a> for more
82         information.
83         <p>
84 <!--
85         <li> -internalize-public-api-file &lt;filename&gt;
86         <br>
87         Preserve the symbol names listed in the file filename.
88         <p>
89
90         <li> -internalize-public-api-list=&lt;list&gt;
91         <br>
92         Perserve the symbol names specified.
93         <p>
94 -->
95
96         <li> -q
97         <br>
98         Quiet mode.  Do not print messages on whether the program was modified.
99         <p>
100
101         <li> -load &lt;plugin&gt;
102         <br>
103         Load the dynamic object &lt;plugin&gt;.  This object should register new
104         optimization passes.  Once loaded, the object will add new command line
105         options to enable various optimizations.  To see the new complete list
106         of optimizations, use the -help and -load options together:
107         <p>
108         <tt>opt -load  &lt;plugin&gt; -help</tt>
109         <p>
110
111         <li> -p
112         <br>
113         Print module after each transformation.
114         <p>
115 </ul>
116
117 <h3>EXIT STATUS</h3>
118
119 If <tt>opt</tt> succeeds, it will exit with 0.  Otherwise, if an error occurs,
120 it will exit with a non-zero value.
121
122 <h3>SEE ALSO</h3>
123
124 <a href="analyze.html"><tt>analyze</tt></a>
125
126 <HR>
127 Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
128 </body>
129 </html>
130