John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 1 | <html> |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 2 | <title>LLVM: llc tool</title> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 3 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 4 | <body bgcolor=white> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 5 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 6 | <center><h1>LLVM: <tt>llc</tt> tool</h1></center> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 7 | <HR> |
| 8 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 9 | <h3>NAME</h3> |
| 10 | <tt>llc</tt> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 11 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 12 | <h3>SYNOPSIS</h3> |
| 13 | <tt>llc [options] [filename]</tt> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 14 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 15 | <h3>DESCRIPTION</h3> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 16 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 17 | The <tt>llc</tt> command compiles LLVM bytecode into assembly language for a |
| 18 | specified architecture. The assembly language output can then be passed through |
| 19 | a native assembler and linker to generate native code. |
John Criswell | 511a491 | 2003-09-29 20:10:08 +0000 | [diff] [blame] | 20 | <p> |
| 21 | The choice of architecture for the output assembly code is determined as |
| 22 | follows: |
| 23 | |
| 24 | <ul> |
| 25 | <li> |
| 26 | If the user has specified an architecture with the -m option, use that |
| 27 | architecture. |
| 28 | <p> |
| 29 | |
| 30 | <li> |
| 31 | Examine the input LLVM bytecode file: |
| 32 | <ul> |
| 33 | <li> |
| 34 | If it specifies little endian and a pointer size of 32 bits, select the |
| 35 | x86 architecture. |
| 36 | <p> |
| 37 | |
| 38 | <li> |
| 39 | If it specifies big endian and a pointer size of 64 bit pointers, |
| 40 | select the SparcV9 architecture. |
| 41 | </ul> |
| 42 | <p> |
| 43 | |
| 44 | <li> |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 45 | If <tt>llc</tt> was compiled on an architecture for which it can |
| 46 | generate code, select the architecture upon which <tt>llc</tt> was |
| 47 | compiled. |
John Criswell | 511a491 | 2003-09-29 20:10:08 +0000 | [diff] [blame] | 48 | <p> |
| 49 | |
| 50 | <li> |
| 51 | Print a message to the user asking him or her to specify the output |
| 52 | architecture explicitly. |
| 53 | </ul> |
| 54 | |
| 55 | <p> |
| 56 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 57 | If filename is not specified, or if filename is -, <tt>llc</tt> reads its input |
| 58 | from standard input. Otherwise, it will read its input from filename. |
John Criswell | 511a491 | 2003-09-29 20:10:08 +0000 | [diff] [blame] | 59 | <p> |
| 60 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 61 | If the -o option is left unspecified, then <tt>llc</tt> will send its output to standard |
John Criswell | 511a491 | 2003-09-29 20:10:08 +0000 | [diff] [blame] | 62 | output if the input is from standard input. If the -o option specifies -, then |
| 63 | the output will also be sent to standard output. |
| 64 | <p> |
| 65 | |
| 66 | If no -o option is specified and an input file other than - is specified, then |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 67 | <tt>llc</tt> creates the output filename as follows: |
John Criswell | 511a491 | 2003-09-29 20:10:08 +0000 | [diff] [blame] | 68 | |
| 69 | <ul> |
| 70 | <li> |
| 71 | If the file ends in .bc, then the .bc suffix is removed, and the .s suffix |
| 72 | is appended. |
| 73 | <p> |
| 74 | <li> |
| 75 | Otherwise, the .s suffix is appended to the input filename. |
| 76 | </ul> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 77 | |
| 78 | <h3> |
| 79 | OPTIONS |
| 80 | </h3> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 81 | <ul> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 82 | <li>-f |
| 83 | <br> |
| 84 | Overwrite output files |
| 85 | <p> |
| 86 | |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 87 | <li>-m<arch> |
| 88 | <br> |
| 89 | Specify the architecture for which to generate assembly. Valid |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 90 | architectures are: |
| 91 | |
| 92 | <dl compact> |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 93 | <dt> x86 </dt> |
Alkis Evlogimenos | eed462b | 2003-10-02 06:13:19 +0000 | [diff] [blame] | 94 | <dd>IA-32 (Pentium and above)</dd> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 95 | |
John Criswell | 8417142 | 2004-03-12 22:45:35 +0000 | [diff] [blame] | 96 | <dt> sparcv9 </dt> |
Alkis Evlogimenos | eed462b | 2003-10-02 06:13:19 +0000 | [diff] [blame] | 97 | <dd>SPARC V9</dd> |
Chris Lattner | 15a2986 | 2004-02-18 23:30:02 +0000 | [diff] [blame] | 98 | |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 99 | <dt> c </dt> |
Chris Lattner | 15a2986 | 2004-02-18 23:30:02 +0000 | [diff] [blame] | 100 | <dd>Emit C code</dd> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 101 | </dl> |
| 102 | <p> |
| 103 | |
| 104 | <li>-o <filename> |
| 105 | <br> |
John Criswell | 511a491 | 2003-09-29 20:10:08 +0000 | [diff] [blame] | 106 | Specify the output filename. |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 107 | <p> |
| 108 | |
John Criswell | 8417142 | 2004-03-12 22:45:35 +0000 | [diff] [blame] | 109 | <li>-enable-correct-eh-support |
| 110 | <br> |
| 111 | Instruct the -lowerinvoke pass to insert code for correct exception handling |
| 112 | support. This is expensive and is by default omitted for efficiency. |
| 113 | <p> |
| 114 | |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 115 | <li> -help |
| 116 | <br> |
| 117 | Print a summary of command line options. |
| 118 | <p> |
| 119 | |
| 120 | <li> -stats |
| 121 | <br> |
| 122 | Print statistics. |
| 123 | <p> |
| 124 | |
| 125 | <li> -time-passes |
| 126 | <br> |
| 127 | Record the amount of time needed for each pass and print it to standard |
| 128 | error. |
| 129 | <p> |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 130 | |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 131 | </ul> |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 132 | <h4>X86 Specific Options</h4> |
| 133 | <ul> |
| 134 | <li>-disable-fp-elim |
| 135 | <br> |
| 136 | Disable frame pointer elimination optimization. |
| 137 | <p> |
| 138 | |
| 139 | <li>-disable-pattern-isel |
| 140 | <br> |
| 141 | Use the 'simple' X86 instruction selector (the default). |
| 142 | <p> |
| 143 | |
| 144 | <li>-print-machineinstrs |
| 145 | <br> |
| 146 | Print generated machine code. |
| 147 | <p> |
| 148 | |
| 149 | <li>-regalloc=<ra> |
| 150 | <br> |
Alkis Evlogimenos | 4e644dd | 2004-03-06 22:27:41 +0000 | [diff] [blame] | 151 | Specify the register allocator to use. The default is <i>local</i>. |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 152 | Valid register allocators are: |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 153 | <p> |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 154 | <dl compact> |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 155 | <dt> simple </dt> |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 156 | <dd>Very simple register allocator</dd> |
| 157 | |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 158 | <dt> local </dt> |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 159 | <dd>Local register allocator</dd> |
Alkis Evlogimenos | dd420e0 | 2004-03-01 23:18:15 +0000 | [diff] [blame] | 160 | |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 161 | <dt> linearscan </dt> |
Alkis Evlogimenos | dd420e0 | 2004-03-01 23:18:15 +0000 | [diff] [blame] | 162 | <dd>Linear scan global register allocator (experimental)</dd> |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 163 | </dl> |
Alkis Evlogimenos | dd420e0 | 2004-03-01 23:18:15 +0000 | [diff] [blame] | 164 | |
| 165 | <li>-spiller=<sp> |
| 166 | <br> |
| 167 | Specify the spiller to use for register allocators that support it. |
| 168 | Currently this option is used by the linear scan register |
| 169 | allocator. The default is <i>local</i>. |
| 170 | Valid spillers are: |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 171 | <p> |
Alkis Evlogimenos | dd420e0 | 2004-03-01 23:18:15 +0000 | [diff] [blame] | 172 | <dl compact> |
Alkis Evlogimenos | 499b2ba | 2004-03-06 22:38:29 +0000 | [diff] [blame] | 173 | <dt> simple </dt> |
| 174 | <dd>Simple spiller</dd> |
| 175 | |
Alkis Evlogimenos | 89157a2 | 2004-03-02 03:36:10 +0000 | [diff] [blame] | 176 | <dt> local </dt> |
Alkis Evlogimenos | dd420e0 | 2004-03-01 23:18:15 +0000 | [diff] [blame] | 177 | <dd>Local spiller</dd> |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 178 | </dl> |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 179 | |
| 180 | </ul> |
| 181 | |
| 182 | <h4>Sparc Specific Options</h4> |
| 183 | <ul> |
| 184 | <li>-disable-peephole |
| 185 | <br> |
| 186 | Disable peephole optimization pass. |
| 187 | <p> |
| 188 | |
Chris Lattner | 7a59bc8 | 2003-10-07 19:42:50 +0000 | [diff] [blame] | 189 | <li>-disable-sched |
| 190 | <br> |
| 191 | Disable local scheduling pass. |
| 192 | <p> |
| 193 | |
| 194 | <li>-disable-strip |
| 195 | <br> |
| 196 | Do not strip the LLVM bytecode included in executable. |
| 197 | <p> |
| 198 | |
| 199 | <li>-enable-maps |
| 200 | <br> |
| 201 | Emit LLVM-to-MachineCode mapping info to assembly. |
| 202 | <p> |
| 203 | </ul> |
| 204 | |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 205 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 206 | <h3>EXIT STATUS</h3> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 207 | |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 208 | If <tt>llc</tt> succeeds, it will exit with 0. Otherwise, if an error occurs, |
| 209 | it will exit with a non-zero value. |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 210 | |
| 211 | <h3> |
| 212 | SEE ALSO |
| 213 | </h3> |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 214 | <a href="lli.html"><tt>lli</tt></a> |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 215 | |
| 216 | <HR> |
Chris Lattner | 08a04fd | 2003-10-07 20:12:05 +0000 | [diff] [blame] | 217 | Maintained by the <a href="http://llvm.cs.uiuc.edu">LLVM Team</a>. |
John Criswell | 69d903d | 2003-09-12 15:46:24 +0000 | [diff] [blame] | 218 | </body> |
| 219 | </html> |
| 220 | |