2003-09-11 19:58:03 +00:00
|
|
|
<html>
|
2003-10-07 20:17:24 +00:00
|
|
|
<title>LLVM: opt tool</title>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:12:05 +00:00
|
|
|
<body bgcolor=white>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
<center><h1>LLVM: <tt>opt</tt> tool</h1></center>
|
2003-09-11 19:58:03 +00:00
|
|
|
<HR>
|
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
<h3>NAME</h3>
|
|
|
|
<tt>opt</tt>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
<h3>SYNOPSIS</h3>
|
|
|
|
<tt>opt [options] [filename]</tt>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
<h3>DESCRIPTION</h3>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
The <tt>opt</tt> command is the modular LLVM optimizer. It takes LLVM bytecode
|
|
|
|
as input, runs the specified optimizations on it, and then outputs the optimized
|
|
|
|
LLVM bytecode.
|
2003-09-26 16:32:00 +00:00
|
|
|
<p>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
The optimizations available via <tt>opt</tt> depend upon what libraries were
|
|
|
|
linked into it as well as any additional libraries that have been loaded with
|
|
|
|
the <tt>-load</tt> option. Use the <tt>-help</tt> option to determine what
|
|
|
|
optimizations you can use.
|
2003-09-26 16:32:00 +00:00
|
|
|
<p>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
If no filename is specified on the command line, <tt>opt</tt> reads its input
|
|
|
|
from standard input.
|
2003-09-26 16:32:00 +00:00
|
|
|
<p>
|
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
If an output filename is not specified with the <tt>-o</tt> option, <tt>opt</tt>
|
|
|
|
writes its output to the standard output.
|
|
|
|
|
|
|
|
|
|
|
|
<h3>OPTIONS</h3>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li> -f
|
|
|
|
<br>
|
2003-10-07 20:17:24 +00:00
|
|
|
Force overwrite. Normally, <tt>opt</tt> will refuse to overwrite an
|
|
|
|
output file that already exists. With this option, <tt>opt</tt> will
|
|
|
|
overwrite the output file and replace it with new bytecode.
|
2003-09-11 19:58:03 +00:00
|
|
|
<p>
|
|
|
|
|
|
|
|
<li> -help
|
|
|
|
<br>
|
|
|
|
Print a summary of command line options.
|
|
|
|
<p>
|
|
|
|
|
|
|
|
<li> -o <filename>
|
|
|
|
<br>
|
|
|
|
Specify the output filename.
|
|
|
|
<p>
|
|
|
|
|
|
|
|
<li> -stats
|
|
|
|
<br>
|
|
|
|
Print statistics.
|
|
|
|
<p>
|
|
|
|
|
|
|
|
<li> -time-passes
|
|
|
|
<br>
|
|
|
|
Record the amount of time needed for each pass and print it to standard
|
|
|
|
error.
|
|
|
|
<p>
|
|
|
|
|
2003-10-07 16:33:42 +00:00
|
|
|
<li> -debug
|
|
|
|
<br>
|
|
|
|
If this is a debug build, this option will enable debug printouts from
|
|
|
|
passes which use the <tt>DEBUG</tt> macro. See the <a
|
|
|
|
href="../ProgrammersManual.html#DEBUG">Programmer's Manual</a> for more
|
|
|
|
information.
|
|
|
|
<p>
|
|
|
|
<!--
|
2003-09-11 19:58:03 +00:00
|
|
|
<li> -internalize-public-api-file <filename>
|
|
|
|
<br>
|
|
|
|
Preserve the symbol names listed in the file filename.
|
|
|
|
<p>
|
|
|
|
|
|
|
|
<li> -internalize-public-api-list=<list>
|
|
|
|
<br>
|
|
|
|
Perserve the symbol names specified.
|
|
|
|
<p>
|
2003-10-07 16:33:42 +00:00
|
|
|
-->
|
2003-09-11 19:58:03 +00:00
|
|
|
|
|
|
|
<li> -q
|
|
|
|
<br>
|
|
|
|
Quiet mode. Do not print messages on whether the program was modified.
|
|
|
|
<p>
|
|
|
|
|
|
|
|
<li> -load <plugin.so>
|
|
|
|
<br>
|
2003-10-19 18:08:57 +00:00
|
|
|
Load the dynamic object <plugin.so>. This object should register new
|
2003-09-11 19:58:03 +00:00
|
|
|
optimization passes. Once loaded, the object will add new command line
|
|
|
|
options to enable various optimizations. To see the new complete list
|
|
|
|
of optimizations, use the -help and -load options together:
|
|
|
|
<p>
|
2003-10-07 20:17:24 +00:00
|
|
|
<tt>opt -load <plugin.so> -help</tt>
|
2003-09-11 19:58:03 +00:00
|
|
|
<p>
|
|
|
|
|
|
|
|
<li> -p
|
|
|
|
<br>
|
|
|
|
Print module after each transformation.
|
|
|
|
<p>
|
|
|
|
</ul>
|
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
<h3>EXIT STATUS</h3>
|
|
|
|
|
|
|
|
If <tt>opt</tt> succeeds, it will exit with 0. Otherwise, if an error occurs,
|
|
|
|
it will exit with a non-zero value.
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
<h3>SEE ALSO</h3>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
2003-10-07 20:17:24 +00:00
|
|
|
<a href="analyze.html"><tt>analyze</tt></a>
|
2003-09-11 19:58:03 +00:00
|
|
|
|
|
|
|
<HR>
|
2003-10-07 20:12:05 +00:00
|
|
|
Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.
|
2003-09-11 19:58:03 +00:00
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|