Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 1 | =pod |
| 2 | |
| 3 | =head1 NAME |
| 4 | |
| 5 | llc - LLVM static compiler |
| 6 | |
| 7 | =head1 SYNOPSIS |
| 8 | |
Misha Brukman | c08937a | 2004-07-02 16:06:19 +0000 | [diff] [blame] | 9 | B<llc> [I<options>] [I<filename>] |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 10 | |
| 11 | =head1 DESCRIPTION |
| 12 | |
Gabor Greif | 3bd6e0d | 2007-07-09 11:24:05 +0000 | [diff] [blame] | 13 | The B<llc> command compiles LLVM bitcode into assembly language for a |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 14 | specified architecture. The assembly language output can then be passed through |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 15 | a native assembler and linker to generate a native executable. |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 16 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 17 | The choice of architecture for the output assembly code is automatically |
Gabor Greif | 3bd6e0d | 2007-07-09 11:24:05 +0000 | [diff] [blame] | 18 | determined from the input bitcode file, unless the B<-march> option is used to |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 19 | override the default. |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 20 | |
| 21 | =head1 OPTIONS |
| 22 | |
Gabor Greif | 3bd6e0d | 2007-07-09 11:24:05 +0000 | [diff] [blame] | 23 | If I<filename> is - or omitted, B<llc> reads LLVM bitcode from standard input. |
| 24 | Otherwise, it will read LLVM bitcode from I<filename>. |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 25 | |
| 26 | If the B<-o> option is omitted, then B<llc> will send its output to standard |
| 27 | output if the input is from standard input. If the B<-o> option specifies -, |
| 28 | then the output will also be sent to standard output. |
| 29 | |
| 30 | If no B<-o> option is specified and an input file other than - is specified, |
| 31 | then B<llc> creates the output filename by taking the input filename, |
| 32 | removing any existing F<.bc> extension, and adding a F<.s> suffix. |
| 33 | |
| 34 | Other B<llc> options are as follows: |
| 35 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 36 | =head2 End-user Options |
| 37 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 38 | =over |
| 39 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 40 | =item B<--help> |
| 41 | |
| 42 | Print a summary of command line options. |
| 43 | |
Bill Wendling | be8cc2a | 2009-04-29 00:15:41 +0000 | [diff] [blame] | 44 | =item B<-O>=I<uint> |
| 45 | |
| 46 | Generate code at different optimization levels. These correspond to the I<-O0>, |
| 47 | I<-O1>, I<-O2>, I<-O3>, and I<-O4> optimization levels used by B<llvm-gcc> and |
| 48 | B<clang>. |
| 49 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 50 | =item B<-f> |
| 51 | |
Dan Gohman | 0cabaa5 | 2009-08-25 15:54:01 +0000 | [diff] [blame^] | 52 | Enable binary output on terminals. Normally, B<llvm-extract> will refuse to |
| 53 | write raw bitcode output if the output stream is a terminal. With this option, |
| 54 | B<llvm-extract> will write raw bitcode regardless of the output device. |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 55 | |
Chris Lattner | f495536 | 2005-12-16 05:19:35 +0000 | [diff] [blame] | 56 | =item B<-mtriple>=I<target triple> |
Chris Lattner | 4f501bf | 2005-12-16 05:18:53 +0000 | [diff] [blame] | 57 | |
Gabor Greif | 3bd6e0d | 2007-07-09 11:24:05 +0000 | [diff] [blame] | 58 | Override the target triple specified in the input bitcode file with the |
Chris Lattner | 4f501bf | 2005-12-16 05:18:53 +0000 | [diff] [blame] | 59 | specified string. |
| 60 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 61 | =item B<-march>=I<arch> |
| 62 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 63 | Specify the architecture for which to generate assembly, overriding the target |
Gabor Greif | 3bd6e0d | 2007-07-09 11:24:05 +0000 | [diff] [blame] | 64 | encoded in the bitcode file. See the output of B<llc --help> for a list of |
Chris Lattner | 4f501bf | 2005-12-16 05:18:53 +0000 | [diff] [blame] | 65 | valid architectures. By default this is inferred from the target triple or |
| 66 | autodetected to the current architecture. |
| 67 | |
| 68 | =item B<-mcpu>=I<cpuname> |
| 69 | |
| 70 | Specify a specific chip in the current architecture to generate code for. |
| 71 | By default this is inferred from the target triple and autodetected to |
| 72 | the current architecture. For a list of available CPUs, use: |
| 73 | B<llvm-as E<lt> /dev/null | llc -march=xyz -mcpu=help> |
| 74 | |
| 75 | =item B<-mattr>=I<a1,+a2,-a3,...> |
| 76 | |
| 77 | Override or control specific attributes of the target, such as whether SIMD |
| 78 | operations are enabled or not. The default set of attributes is set by the |
| 79 | current CPU. For a list of available attributes, use: |
| 80 | B<llvm-as E<lt> /dev/null | llc -march=xyz -mattr=help> |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 81 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 82 | =item B<--disable-fp-elim> |
| 83 | |
| 84 | Disable frame pointer elimination optimization. |
| 85 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 86 | =item B<--disable-excess-fp-precision> |
| 87 | |
| 88 | Disable optimizations that may produce excess precision for floating point. |
| 89 | Note that this option can dramatically slow down code on some systems |
| 90 | (e.g. X86). |
| 91 | |
| 92 | =item B<--enable-unsafe-fp-math> |
| 93 | |
| 94 | Enable optimizations that make unsafe assumptions about IEEE math (e.g. that |
| 95 | addition is associative) or may not work for all input ranges. These |
| 96 | optimizations allow the code generator to make use of some instructions which |
| 97 | would otherwise not be usable (such as fsin on X86). |
| 98 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 99 | =item B<--enable-correct-eh-support> |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 100 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 101 | Instruct the B<lowerinvoke> pass to insert code for correct exception handling |
| 102 | support. This is expensive and is by default omitted for efficiency. |
| 103 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 104 | =item B<--stats> |
| 105 | |
| 106 | Print statistics recorded by code-generation passes. |
| 107 | |
| 108 | =item B<--time-passes> |
| 109 | |
| 110 | Record the amount of time needed for each pass and print a report to standard |
| 111 | error. |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 112 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 113 | =item B<--load>=F<dso_path> |
| 114 | |
| 115 | Dynamically load F<dso_path> (a path to a dynamically shared object) that |
| 116 | implements an LLVM target. This will permit the target name to be used with the |
| 117 | B<-march> option so that code can be generated for that target. |
| 118 | |
| 119 | =back |
| 120 | |
| 121 | =head2 Tuning/Configuration Options |
| 122 | |
| 123 | =over |
| 124 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 125 | =item B<--print-machineinstrs> |
| 126 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 127 | Print generated machine code between compilation phases (useful for debugging). |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 128 | |
| 129 | =item B<--regalloc>=I<allocator> |
| 130 | |
| 131 | Specify the register allocator to use. The default I<allocator> is I<local>. |
| 132 | Valid register allocators are: |
| 133 | |
| 134 | =over |
| 135 | |
| 136 | =item I<simple> |
| 137 | |
| 138 | Very simple "always spill" register allocator |
| 139 | |
| 140 | =item I<local> |
| 141 | |
| 142 | Local register allocator |
| 143 | |
| 144 | =item I<linearscan> |
| 145 | |
Alkis Evlogimenos | c8dec2c | 2004-07-21 08:18:50 +0000 | [diff] [blame] | 146 | Linear scan global register allocator |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 147 | |
Misha Brukman | 1e635c3 | 2004-07-21 12:53:14 +0000 | [diff] [blame] | 148 | =item I<iterativescan> |
Alkis Evlogimenos | 910d0d6 | 2004-07-21 08:24:35 +0000 | [diff] [blame] | 149 | |
| 150 | Iterative scan global register allocator |
| 151 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 152 | =back |
| 153 | |
| 154 | =item B<--spiller>=I<spiller> |
| 155 | |
| 156 | Specify the spiller to use for register allocators that support it. Currently |
| 157 | this option is used only by the linear scan register allocator. The default |
| 158 | I<spiller> is I<local>. Valid spillers are: |
| 159 | |
| 160 | =over |
| 161 | |
| 162 | =item I<simple> |
| 163 | |
| 164 | Simple spiller |
| 165 | |
| 166 | =item I<local> |
| 167 | |
| 168 | Local spiller |
| 169 | |
| 170 | =back |
| 171 | |
| 172 | =back |
| 173 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 174 | =head2 Intel IA-32-specific Options |
| 175 | |
| 176 | =over |
| 177 | |
| 178 | =item B<--x86-asm-syntax=att|intel> |
| 179 | |
| 180 | Specify whether to emit assembly code in AT&T syntax (the default) or intel |
| 181 | syntax. |
| 182 | |
| 183 | =back |
| 184 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 185 | =head1 EXIT STATUS |
| 186 | |
| 187 | If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs, |
| 188 | it will exit with a non-zero value. |
| 189 | |
| 190 | =head1 SEE ALSO |
| 191 | |
Misha Brukman | c08937a | 2004-07-02 16:06:19 +0000 | [diff] [blame] | 192 | L<lli|lli> |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 193 | |
| 194 | =head1 AUTHORS |
| 195 | |
Reid Spencer | cd143fc | 2006-03-14 05:42:07 +0000 | [diff] [blame] | 196 | Maintained by the LLVM Team (L<http://llvm.org>). |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 197 | |
| 198 | =cut |