Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 1 | lli - directly execute programs from LLVM bitcode |
| 2 | ================================================= |
| 3 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 4 | SYNOPSIS |
| 5 | -------- |
| 6 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 7 | :program:`lli` [*options*] [*filename*] [*program args*] |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 8 | |
| 9 | DESCRIPTION |
| 10 | ----------- |
| 11 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 12 | :program:`lli` directly executes programs in LLVM bitcode format. It takes a program |
| 13 | in LLVM bitcode format and executes it using a just-in-time compiler or an |
| 14 | interpreter. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 15 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 16 | :program:`lli` is *not* an emulator. It will not execute IR of different architectures |
| 17 | and it can only interpret (or JIT-compile) for the host architecture. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 18 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 19 | The JIT compiler takes the same arguments as other tools, like :program:`llc`, |
| 20 | but they don't necessarily work for the interpreter. |
| 21 | |
| 22 | If `filename` is not specified, then :program:`lli` reads the LLVM bitcode for the |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 23 | program from standard input. |
| 24 | |
| 25 | The optional *args* specified on the command line are passed to the program as |
| 26 | arguments. |
| 27 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 28 | GENERAL OPTIONS |
| 29 | --------------- |
| 30 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 31 | .. option:: -fake-argv0=executable |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 32 | |
| 33 | Override the ``argv[0]`` value passed into the executing program. |
| 34 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 35 | .. option:: -force-interpreter={false,true} |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 36 | |
| 37 | If set to true, use the interpreter even if a just-in-time compiler is available |
| 38 | for this architecture. Defaults to false. |
| 39 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 40 | .. option:: -help |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 41 | |
| 42 | Print a summary of command line options. |
| 43 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 44 | .. option:: -load=pluginfilename |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 45 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 46 | Causes :program:`lli` to load the plugin (shared object) named *pluginfilename* and use |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 47 | it for optimization. |
| 48 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 49 | .. option:: -stats |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 50 | |
| 51 | Print statistics from the code-generation passes. This is only meaningful for |
| 52 | the just-in-time compiler, at present. |
| 53 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 54 | .. option:: -time-passes |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 55 | |
| 56 | Record the amount of time needed for each code-generation pass and print it to |
| 57 | standard error. |
| 58 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 59 | .. option:: -version |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 60 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 61 | Print out the version of :program:`lli` and exit without doing anything else. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 62 | |
| 63 | TARGET OPTIONS |
| 64 | -------------- |
| 65 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 66 | .. option:: -mtriple=target triple |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 67 | |
| 68 | Override the target triple specified in the input bitcode file with the |
| 69 | specified string. This may result in a crash if you pick an |
| 70 | architecture which is not compatible with the current system. |
| 71 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 72 | .. option:: -march=arch |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 73 | |
| 74 | Specify the architecture for which to generate assembly, overriding the target |
| 75 | encoded in the bitcode file. See the output of **llc -help** for a list of |
| 76 | valid architectures. By default this is inferred from the target triple or |
| 77 | autodetected to the current architecture. |
| 78 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 79 | .. option:: -mcpu=cpuname |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 80 | |
| 81 | Specify a specific chip in the current architecture to generate code for. |
| 82 | By default this is inferred from the target triple and autodetected to |
| 83 | the current architecture. For a list of available CPUs, use: |
| 84 | **llvm-as < /dev/null | llc -march=xyz -mcpu=help** |
| 85 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 86 | .. option:: -mattr=a1,+a2,-a3,... |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 87 | |
| 88 | Override or control specific attributes of the target, such as whether SIMD |
| 89 | operations are enabled or not. The default set of attributes is set by the |
| 90 | current CPU. For a list of available attributes, use: |
| 91 | **llvm-as < /dev/null | llc -march=xyz -mattr=help** |
| 92 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 93 | FLOATING POINT OPTIONS |
| 94 | ---------------------- |
| 95 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 96 | .. option:: -disable-excess-fp-precision |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 97 | |
| 98 | Disable optimizations that may increase floating point precision. |
| 99 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 100 | .. option:: -enable-no-infs-fp-math |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 101 | |
| 102 | Enable optimizations that assume no Inf values. |
| 103 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 104 | .. option:: -enable-no-nans-fp-math |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 105 | |
| 106 | Enable optimizations that assume no NAN values. |
| 107 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 108 | .. option:: -enable-unsafe-fp-math |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 109 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 110 | Causes :program:`lli` to enable optimizations that may decrease floating point |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 111 | precision. |
| 112 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 113 | .. option:: -soft-float |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 114 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 115 | Causes :program:`lli` to generate software floating point library calls instead of |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 116 | equivalent hardware instructions. |
| 117 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 118 | CODE GENERATION OPTIONS |
| 119 | ----------------------- |
| 120 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 121 | .. option:: -code-model=model |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 122 | |
| 123 | Choose the code model from: |
| 124 | |
Jonas Devlieghere | 2b2534c | 2017-11-06 11:47:24 +0000 | [diff] [blame] | 125 | .. code-block:: text |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 126 | |
| 127 | default: Target default code model |
David Green | 3d765ce | 2018-08-22 11:31:39 +0000 | [diff] [blame] | 128 | tiny: Tiny code model |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 129 | small: Small code model |
| 130 | kernel: Kernel code model |
| 131 | medium: Medium code model |
| 132 | large: Large code model |
| 133 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 134 | .. option:: -disable-post-RA-scheduler |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 135 | |
| 136 | Disable scheduling after register allocation. |
| 137 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 138 | .. option:: -disable-spill-fusing |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 139 | |
| 140 | Disable fusing of spill code into instructions. |
| 141 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 142 | .. option:: -jit-enable-eh |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 143 | |
| 144 | Exception handling should be enabled in the just-in-time compiler. |
| 145 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 146 | .. option:: -join-liveintervals |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 147 | |
| 148 | Coalesce copies (default=true). |
| 149 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 150 | .. option:: -nozero-initialized-in-bss |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 151 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 152 | Don't place zero-initialized symbols into the BSS section. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 153 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 154 | .. option:: -pre-RA-sched=scheduler |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 155 | |
| 156 | Instruction schedulers available (before register allocation): |
| 157 | |
Jonas Devlieghere | 2b2534c | 2017-11-06 11:47:24 +0000 | [diff] [blame] | 158 | .. code-block:: text |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 159 | |
| 160 | =default: Best scheduler for the target |
| 161 | =none: No scheduling: breadth first sequencing |
| 162 | =simple: Simple two pass scheduling: minimize critical path and maximize processor utilization |
| 163 | =simple-noitin: Simple two pass scheduling: Same as simple except using generic latency |
| 164 | =list-burr: Bottom-up register reduction list scheduling |
| 165 | =list-tdrr: Top-down register reduction list scheduling |
| 166 | =list-td: Top-down list scheduler -print-machineinstrs - Print generated machine code |
| 167 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 168 | .. option:: -regalloc=allocator |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 169 | |
| 170 | Register allocator to use (default=linearscan) |
| 171 | |
Jonas Devlieghere | 2b2534c | 2017-11-06 11:47:24 +0000 | [diff] [blame] | 172 | .. code-block:: text |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 173 | |
| 174 | =bigblock: Big-block register allocator |
| 175 | =linearscan: linear scan register allocator =local - local register allocator |
| 176 | =simple: simple register allocator |
| 177 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 178 | .. option:: -relocation-model=model |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 179 | |
| 180 | Choose relocation model from: |
| 181 | |
Jonas Devlieghere | 2b2534c | 2017-11-06 11:47:24 +0000 | [diff] [blame] | 182 | .. code-block:: text |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 183 | |
| 184 | =default: Target default relocation model |
| 185 | =static: Non-relocatable code =pic - Fully relocatable, position independent code |
| 186 | =dynamic-no-pic: Relocatable external references, non-relocatable code |
| 187 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 188 | .. option:: -spiller |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 189 | |
| 190 | Spiller to use (default=local) |
| 191 | |
Jonas Devlieghere | 2b2534c | 2017-11-06 11:47:24 +0000 | [diff] [blame] | 192 | .. code-block:: text |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 193 | |
| 194 | =simple: simple spiller |
| 195 | =local: local spiller |
| 196 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 197 | .. option:: -x86-asm-syntax=syntax |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 198 | |
| 199 | Choose style of code to emit from X86 backend: |
| 200 | |
Jonas Devlieghere | 2b2534c | 2017-11-06 11:47:24 +0000 | [diff] [blame] | 201 | .. code-block:: text |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 202 | |
| 203 | =att: Emit AT&T-style assembly |
| 204 | =intel: Emit Intel-style assembly |
| 205 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 206 | EXIT STATUS |
| 207 | ----------- |
| 208 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 209 | If :program:`lli` fails to load the program, it will exit with an exit code of 1. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 210 | Otherwise, it will return the exit code of the program it executes. |
| 211 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 212 | SEE ALSO |
| 213 | -------- |
| 214 | |
Renato Golin | d625452 | 2015-07-28 10:24:11 +0000 | [diff] [blame] | 215 | :program:`llc` |