blob: 52b168393e8a694542002ca646725305782e52a2 [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
77 <li> -internalize-public-api-file &lt;filename&gt;
78 <br>
79 Preserve the symbol names listed in the file filename.
80 <p>
81
82 <li> -internalize-public-api-list=&lt;list&gt;
83 <br>
84 Perserve the symbol names specified.
85 <p>
86
87 <li> -q
88 <br>
89 Quiet mode. Do not print messages on whether the program was modified.
90 <p>
91
92 <li> -load &lt;plugin.so&gt;
93 <br>
94 Load the dynamic object plugin.so. This object should register new
95 optimization passes. Once loaded, the object will add new command line
96 options to enable various optimizations. To see the new complete list
97 of optimizations, use the -help and -load options together:
98 <p>
99 opt -load &lt;plugin.so&gt; -help
100 <p>
101
102 <li> -p
103 <br>
104 Print module after each transformation.
105 <p>
106</ul>
107
108<h3>
109EXIT STATUS
110</h3>
111
112If opt succeeds, it will exit with 0. Otherwise, if an error occurs, it
113will exit with a non-zero value.
114
115<h3>
116SEE ALSO
117</h3>
118analyze
119
120<HR>
John Criswell32003302003-09-11 20:23:52 +0000121<a href="http://llvm.cs.uiuc.edu">LLVM Team</a>
John Criswellecf32e52003-09-11 19:58:03 +0000122</body>
123</html>
124