John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 1 | <html> |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 2 | <title>LLVM: opt tool</title> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 3 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 4 | <body bgcolor=white> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 5 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 6 | <center><h1>LLVM: <tt>opt</tt> tool</h1></center> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 7 | <HR> |
| 8 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 9 | <h3>NAME</h3> |
| 10 | <tt>opt</tt> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 11 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 12 | <h3>SYNOPSIS</h3> |
| 13 | <tt>opt [options] [filename]</tt> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 14 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 15 | <h3>DESCRIPTION</h3> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 16 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 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 |
| 19 | LLVM bytecode. |
John Criswell | 6243534 | 2003-09-26 16:32:00 +0000 | [diff] [blame] | 20 | <p> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 21 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 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. |
John Criswell | 6243534 | 2003-09-26 16:32:00 +0000 | [diff] [blame] | 26 | <p> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 27 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 28 | If no filename is specified on the command line, <tt>opt</tt> reads its input |
| 29 | from standard input. |
John Criswell | 6243534 | 2003-09-26 16:32:00 +0000 | [diff] [blame] | 30 | <p> |
| 31 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 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. |
| 34 | |
| 35 | |
| 36 | <h3>OPTIONS</h3> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 37 | |
| 38 | <ul> |
| 39 | <li> -f |
| 40 | <br> |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 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. |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 44 | <p> |
| 45 | |
| 46 | <li> -help |
| 47 | <br> |
| 48 | Print a summary of command line options. |
| 49 | <p> |
| 50 | |
| 51 | <li> -o <filename> |
| 52 | <br> |
| 53 | Specify the output filename. |
| 54 | <p> |
| 55 | |
| 56 | <li> -stats |
| 57 | <br> |
| 58 | Print statistics. |
| 59 | <p> |
| 60 | |
| 61 | <li> -time-passes |
| 62 | <br> |
| 63 | Record the amount of time needed for each pass and print it to standard |
| 64 | error. |
| 65 | <p> |
| 66 | |
Chris Lattner | a2a628f | 2003-10-07 16:33:42 +0000 | [diff] [blame] | 67 | <li> -debug |
| 68 | <br> |
| 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 |
| 72 | information. |
| 73 | <p> |
| 74 | <!-- |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 75 | <li> -internalize-public-api-file <filename> |
| 76 | <br> |
| 77 | Preserve the symbol names listed in the file filename. |
| 78 | <p> |
| 79 | |
| 80 | <li> -internalize-public-api-list=<list> |
| 81 | <br> |
| 82 | Perserve the symbol names specified. |
| 83 | <p> |
Chris Lattner | a2a628f | 2003-10-07 16:33:42 +0000 | [diff] [blame] | 84 | --> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 85 | |
| 86 | <li> -q |
| 87 | <br> |
| 88 | Quiet mode. Do not print messages on whether the program was modified. |
| 89 | <p> |
| 90 | |
| 91 | <li> -load <plugin.so> |
| 92 | <br> |
| 93 | Load the dynamic object plugin.so. 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: |
| 97 | <p> |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 98 | <tt>opt -load <plugin.so> -help</tt> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 99 | <p> |
| 100 | |
| 101 | <li> -p |
| 102 | <br> |
| 103 | Print module after each transformation. |
| 104 | <p> |
| 105 | </ul> |
| 106 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 107 | <h3>EXIT STATUS</h3> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 108 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 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. |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 111 | |
Chris Lattner | 26814d0 | 2003-10-07 20:17:24 +0000 | [diff] [blame] | 112 | <h3>SEE ALSO</h3> |
| 113 | |
| 114 | <a href="analyze.html"><tt>analyze</tt></a> |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 115 | |
| 116 | <HR> |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 117 | Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>. |
John Criswell | ecf32e5 | 2003-09-11 19:58:03 +0000 | [diff] [blame] | 118 | </body> |
| 119 | </html> |
| 120 | |