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 | |
| 13 | The B<llc> command compiles LLVM bytecode into assembly language for a |
| 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 |
| 18 | determined from the input bytecode file, unless the B<-march> option is used to |
| 19 | override the default. |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 20 | |
| 21 | =head1 OPTIONS |
| 22 | |
| 23 | If I<filename> is - or omitted, B<llc> reads LLVM bytecode from standard input. |
| 24 | Otherwise, it will read LLVM bytecode from I<filename>. |
| 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 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 44 | =item B<-f> |
| 45 | |
| 46 | Overwrite output files. By default, B<llc> will refuse to overwrite |
| 47 | an output file which already exists. |
| 48 | |
Chris Lattner | f495536 | 2005-12-16 05:19:35 +0000 | [diff] [blame^] | 49 | =item B<-mtriple>=I<target triple> |
Chris Lattner | 4f501bf | 2005-12-16 05:18:53 +0000 | [diff] [blame] | 50 | |
| 51 | Override the target triple specified in the input bytecode file with the |
| 52 | specified string. |
| 53 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 54 | =item B<-march>=I<arch> |
| 55 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 56 | Specify the architecture for which to generate assembly, overriding the target |
| 57 | encoded in the bytecode file. See the output of B<llc --help> for a list of |
Chris Lattner | 4f501bf | 2005-12-16 05:18:53 +0000 | [diff] [blame] | 58 | valid architectures. By default this is inferred from the target triple or |
| 59 | autodetected to the current architecture. |
| 60 | |
| 61 | =item B<-mcpu>=I<cpuname> |
| 62 | |
| 63 | Specify a specific chip in the current architecture to generate code for. |
| 64 | By default this is inferred from the target triple and autodetected to |
| 65 | the current architecture. For a list of available CPUs, use: |
| 66 | B<llvm-as E<lt> /dev/null | llc -march=xyz -mcpu=help> |
| 67 | |
| 68 | =item B<-mattr>=I<a1,+a2,-a3,...> |
| 69 | |
| 70 | Override or control specific attributes of the target, such as whether SIMD |
| 71 | operations are enabled or not. The default set of attributes is set by the |
| 72 | current CPU. For a list of available attributes, use: |
| 73 | B<llvm-as E<lt> /dev/null | llc -march=xyz -mattr=help> |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 74 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 75 | =item B<--disable-fp-elim> |
| 76 | |
| 77 | Disable frame pointer elimination optimization. |
| 78 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 79 | =item B<--disable-excess-fp-precision> |
| 80 | |
| 81 | Disable optimizations that may produce excess precision for floating point. |
| 82 | Note that this option can dramatically slow down code on some systems |
| 83 | (e.g. X86). |
| 84 | |
| 85 | =item B<--enable-unsafe-fp-math> |
| 86 | |
| 87 | Enable optimizations that make unsafe assumptions about IEEE math (e.g. that |
| 88 | addition is associative) or may not work for all input ranges. These |
| 89 | optimizations allow the code generator to make use of some instructions which |
| 90 | would otherwise not be usable (such as fsin on X86). |
| 91 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 92 | =item B<--enable-correct-eh-support> |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 93 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 94 | Instruct the B<lowerinvoke> pass to insert code for correct exception handling |
| 95 | support. This is expensive and is by default omitted for efficiency. |
| 96 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 97 | =item B<--stats> |
| 98 | |
| 99 | Print statistics recorded by code-generation passes. |
| 100 | |
| 101 | =item B<--time-passes> |
| 102 | |
| 103 | Record the amount of time needed for each pass and print a report to standard |
| 104 | error. |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 105 | |
Chris Lattner | 1e6df2e | 2005-05-13 20:01:11 +0000 | [diff] [blame] | 106 | =item B<--load>=F<dso_path> |
| 107 | |
| 108 | Dynamically load F<dso_path> (a path to a dynamically shared object) that |
| 109 | implements an LLVM target. This will permit the target name to be used with the |
| 110 | B<-march> option so that code can be generated for that target. |
| 111 | |
| 112 | =back |
| 113 | |
| 114 | =head2 Tuning/Configuration Options |
| 115 | |
| 116 | =over |
| 117 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 118 | =item B<--print-machineinstrs> |
| 119 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 120 | Print generated machine code between compilation phases (useful for debugging). |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 121 | |
| 122 | =item B<--regalloc>=I<allocator> |
| 123 | |
| 124 | Specify the register allocator to use. The default I<allocator> is I<local>. |
| 125 | Valid register allocators are: |
| 126 | |
| 127 | =over |
| 128 | |
| 129 | =item I<simple> |
| 130 | |
| 131 | Very simple "always spill" register allocator |
| 132 | |
| 133 | =item I<local> |
| 134 | |
| 135 | Local register allocator |
| 136 | |
| 137 | =item I<linearscan> |
| 138 | |
Alkis Evlogimenos | c8dec2c | 2004-07-21 08:18:50 +0000 | [diff] [blame] | 139 | Linear scan global register allocator |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 140 | |
Misha Brukman | 1e635c3 | 2004-07-21 12:53:14 +0000 | [diff] [blame] | 141 | =item I<iterativescan> |
Alkis Evlogimenos | 910d0d6 | 2004-07-21 08:24:35 +0000 | [diff] [blame] | 142 | |
| 143 | Iterative scan global register allocator |
| 144 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 145 | =back |
| 146 | |
| 147 | =item B<--spiller>=I<spiller> |
| 148 | |
| 149 | Specify the spiller to use for register allocators that support it. Currently |
| 150 | this option is used only by the linear scan register allocator. The default |
| 151 | I<spiller> is I<local>. Valid spillers are: |
| 152 | |
| 153 | =over |
| 154 | |
| 155 | =item I<simple> |
| 156 | |
| 157 | Simple spiller |
| 158 | |
| 159 | =item I<local> |
| 160 | |
| 161 | Local spiller |
| 162 | |
| 163 | =back |
| 164 | |
| 165 | =back |
| 166 | |
Chris Lattner | 0c123df | 2004-12-09 21:16:40 +0000 | [diff] [blame] | 167 | =head2 Intel IA-32-specific Options |
| 168 | |
| 169 | =over |
| 170 | |
| 171 | =item B<--x86-asm-syntax=att|intel> |
| 172 | |
| 173 | Specify whether to emit assembly code in AT&T syntax (the default) or intel |
| 174 | syntax. |
| 175 | |
| 176 | =back |
| 177 | |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 178 | =head1 EXIT STATUS |
| 179 | |
| 180 | If B<llc> succeeds, it will exit with 0. Otherwise, if an error occurs, |
| 181 | it will exit with a non-zero value. |
| 182 | |
| 183 | =head1 SEE ALSO |
| 184 | |
Misha Brukman | c08937a | 2004-07-02 16:06:19 +0000 | [diff] [blame] | 185 | L<lli|lli> |
Brian Gaeke | e993d20 | 2004-05-14 19:50:33 +0000 | [diff] [blame] | 186 | |
| 187 | =head1 AUTHORS |
| 188 | |
| 189 | Maintained by the LLVM Team (L<http://llvm.cs.uiuc.edu>). |
| 190 | |
| 191 | =cut |