9 B<opt> [I<options>] [I<filename>]
13 The B<opt> command is the modular LLVM optimizer and analyzer. It takes LLVM
14 bytecode as input, runs the specified optimizations or analyses on it, and then
15 outputs the optimized LLVM bytecode or the analysis results. The function of
16 B<opt> depends on whether the B<-analyze> option is given.
18 When B<-analyze> is specified, B<opt> performs various analyses of LLVM
19 bytecode. It will usually print the results on standard output, but in a few
20 cases, it will print output to standard error or generate a file with the
21 analysis output, which is usually done when the output is meant for another
24 While B<-analyze> is I<not> given, B<opt> attempts to produce an optimized
25 bytecode file. The optimizations available via B<opt> depend upon what
26 libraries were linked into it as well as any additional libraries that have
27 been loaded with the B<-load> option. Use the B<-help> option to determine
28 what optimizations you can use.
30 If I<filename> is omitted from the command line or is I<->, B<opt> reads its
31 input from standard input. The input must be an LLVM bytecode file.
33 If an output filename is not specified with the B<-o> option, B<opt>
34 writes its output to the standard output.
42 Force overwrite. Normally, B<opt> will refuse to overwrite an
43 output file that already exists. With this option, B<opt> will
44 overwrite the output file and replace it with new bytecode.
48 Print a summary of command line options.
50 =item B<-o> I<filename>
52 Specify the output filename.
54 =item B<-profile-info-file> I<filename>
56 Specify the name of the file loaded by the -profile-loader option.
64 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
70 from passes which use the I<DEBUG()> macro. See the B<LLVM Programmer's
71 Manual>, section I<#DEBUG> for more information.
73 =item B<-load>=I<plugin>
75 Load the dynamic object I<plugin>. This object should register new optimization
76 or analysis passes. Once loaded, the object will add new command line options to
77 enable various optimizations or analyses. To see the new complete list of
78 optimizations, use the B<-help> and B<-load> options together. For example:
82 B<opt -load>=I<plugin> B<-help>
88 Print module after each transformation.
94 If B<opt> succeeds, it will exit with 0. Otherwise, if an error
95 occurs, it will exit with a non-zero value.
99 Maintained by the LLVM Team (L<http://llvm.org>).