blob: b75620706cf63c113445bce407c02122396ff72e [file] [log] [blame]
John Criswellecf32e52003-09-11 19:58:03 +00001<html>
2<title>
Chris Lattneree43b692003-09-25 19:50:05 +00003LLVM: opt tool
John Criswellecf32e52003-09-11 19:58:03 +00004</title>
5
6<body>
7
8<center>
Chris Lattneree43b692003-09-25 19:50:05 +00009<h1>LLVM: opt tool</h1>
John Criswellecf32e52003-09-11 19:58:03 +000010</center>
11<HR>
12
13<h3>
14NAME
15</h3>
16
17opt
18
19<h3>
20SYNOPSIS
21</h3>
22
John Criswell62435342003-09-26 16:32:00 +000023opt [options] [filename]
John Criswellecf32e52003-09-11 19:58:03 +000024<h3>
25DESCRIPTION
26</h3>
27
28The opt command is the LLVM optimizer. It takes LLVM bytecode as input, runs
John Criswell62435342003-09-26 16:32:00 +000029the specified optimizations on it, and then outputs the optimized LLVM
John Criswellecf32e52003-09-11 19:58:03 +000030bytecode.
John Criswell62435342003-09-26 16:32:00 +000031<p>
John Criswellecf32e52003-09-11 19:58:03 +000032
John Criswell62435342003-09-26 16:32:00 +000033The optimizations available via opt depend upon what libraries were linked
34into it as well as any additional libraries that have been loaded with the
35-load option. Use the -help option to determine what optimizations you can use.
36<p>
John Criswellecf32e52003-09-11 19:58:03 +000037
John Criswell62435342003-09-26 16:32:00 +000038If no filename is specified on the command line, opt reads its input from
39standard input.
40<p>
41
42If an output filename is not specified with the -o option, opt writes its
43output to the standard output.
John Criswellecf32e52003-09-11 19:58:03 +000044<h3>
45OPTIONS
46</h3>
47
48<ul>
49 <li> -f
50 <br>
51 Force overwrite. Normally, opt will refuse to overwrite an output
52 file that already exists. With this option, opt will overwrite the
53 output file and replace it with new bytecode.
54 <p>
55
56 <li> -help
57 <br>
58 Print a summary of command line options.
59 <p>
60
61 <li> -o &lt;filename&gt;
62 <br>
63 Specify the output filename.
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
Chris Lattnera2a628f2003-10-07 16:33:42 +000077 <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<!--
John Criswellecf32e52003-09-11 19:58:03 +000085 <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>
Chris Lattnera2a628f2003-10-07 16:33:42 +000094-->
John Criswellecf32e52003-09-11 19:58:03 +000095
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.so&gt;
102 <br>
103 Load the dynamic object plugin.so. 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 opt -load &lt;plugin.so&gt; -help
109 <p>
110
111 <li> -p
112 <br>
113 Print module after each transformation.
114 <p>
115</ul>
116
117<h3>
118EXIT STATUS
119</h3>
120
121If opt succeeds, it will exit with 0. Otherwise, if an error occurs, it
122will exit with a non-zero value.
123
124<h3>
125SEE ALSO
126</h3>
127analyze
128
129<HR>
John Criswell32003302003-09-11 20:23:52 +0000130<a href="http://llvm.cs.uiuc.edu">LLVM Team</a>
John Criswellecf32e52003-09-11 19:58:03 +0000131</body>
132</html>
133