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