2 <title>LLVM: opt tool</title>
6 <center><h1>LLVM: <tt>opt</tt> tool</h1></center>
13 <tt>opt [options] [filename]</tt>
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
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.
28 If no filename is specified on the command line, <tt>opt</tt> reads its input
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.
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.
48 Print a summary of command line options.
51 <li> -o <filename>
53 Specify the output filename.
63 Record the amount of time needed for each pass and print it to standard
69 If this is a debug build, this option will enable debug printouts from
70 passes which use the <tt>DEBUG</tt> macro. See the <a
71 href="../ProgrammersManual.html#DEBUG">Programmer's Manual</a> for more
75 <li> -internalize-public-api-file <filename>
77 Preserve the symbol names listed in the file filename.
80 <li> -internalize-public-api-list=<list>
82 Perserve the symbol names specified.
88 Quiet mode. Do not print messages on whether the program was modified.
91 <li> -load <plugin>
93 Load the dynamic object <plugin>. This object should register new
94 optimization passes. Once loaded, the object will add new command line
95 options to enable various optimizations. To see the new complete list
96 of optimizations, use the -help and -load options together:
98 <tt>opt -load <plugin> -help</tt>
103 Print module after each transformation.
109 If <tt>opt</tt> succeeds, it will exit with 0. Otherwise, if an error occurs,
110 it will exit with a non-zero value.
114 <a href="analyze.html"><tt>analyze</tt></a>
117 Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>.