LLI(1)
π
LLI(1) β the lli page, aka the LLVM manual's main character β¨
okay so bestie, welcome to lli β yes that's the LLVM manual page, section 1, and she is literally the whole vibe. sit down, get a snack π, and let's get into it.
π NAME π
lli β runs programs straight out of LLVM bitcode, no extra steps, no cap π
β¨ SYNOPSIS β¨
lli [options] [filename] [program args]
π¦ DESCRIPTION π¦
so lli directly executes programs that are in LLVM bitcode format. like, you hand her a program in LLVM bitcode and she runs it β using a just-in-time compiler or an interpreter. she's flexible like that π«Ά
and no, she is not an emulator. not even a little bit. she will not execute IR from different architectures, periodt. she can only interpret (or JIT-compile) for the host architecture β that's her lane and she stays in it π
the JIT compiler takes the same arguments as other tools, like llc, but heads up: those args don't necessarily work for the interpreter. lowkey different beasts, iykyk π
if filename isn't specified, then lli reads the LLVM bitcode for the program from standard input. stdin bestie, she'll take it πΈ
and the optional args you put on the command line? those get passed to the program as arguments. handing out lil gifts π
π GENERAL OPTIONS π
-fake-argv0=executableβ overrides theargv[0]value that gets passed into the executing program. lil identity swap moment π-force-interpreter={false,true}β set it totrueand she'll use the interpreter even if a just-in-time compiler is available for this architecture. defaults tofalse. yes she'll do it the hard way if you ask π-helpβ prints a summary of the command line options. the classic.-load=pluginfilenameβ makeslliload the plugin (that's a shared object) named pluginfilename and use it for optimization. plug her in β¨-statsβ prints statistics from the code-generation passes. ngl this is only meaningful for the just-in-time compiler at present β she's honest about it π-time-passesβ records how much time each code-generation pass needed and prints it to standard error. clocking the girlypops β±οΈ-versionβ prints out the version oflliand exits without doing anything else. she said bye then left π
π₯ TARGET OPTIONS π₯
-mtriple=target tripleβ overrides the target triple baked into the input bitcode file with the string you give her. β οΈ careful bestie, this may result in a crash if you pick an architecture that isn't compatible with the current system. don't do her like that π-march=archβ specifies the architecture to generate assembly for, overriding the target encoded in the bitcode file. for a list of valid architectures, go see the output ofllc -help. by default this is inferred from the target triple, or autodetected to the current architecture.-mcpu=cpunameβ specifies a specific chip in the current architecture to generate code for. by default this is inferred from the target triple and autodetected to the current architecture. for a list of available CPUs, use:
llvm-as < /dev/null | llc -march=xyz -mcpu=help
-mattr=a1,+a2,-a3,...β overrides or controls specific attributes of the target β stuff like whether SIMD operations are enabled or not. the default set of attributes is set by the current CPU. for a list of available attributes, use:
llvm-as < /dev/null | llc -march=xyz -mattr=help
π§ FLOATING POINT OPTIONS π§
-disable-excess-fp-precisionβ disables optimizations that may increase floating point precision.-enable-no-infs-fp-mathβ enables optimizations that assume noInfvalues.-enable-no-nans-fp-mathβ enables optimizations that assume noNANvalues.-enable-unsafe-fp-mathβ causesllito enable optimizations that may decrease floating point precision. unsafe, she said it, not me π«£-soft-floatβ causesllito generate software floating point library calls instead of the equivalent hardware instructions. doing it the soft way π
β CODE GENERATION OPTIONS β
-code-model=modelβ picks the code model from these:default: Target default code modeltiny: Tiny code modelsmall: Small code modelkernel: Kernel code modelmedium: Medium code modellarge: Large code model
-disable-post-RA-schedulerβ disables scheduling after register allocation.-disable-spill-fusingβ disables fusing of spill code into instructions.-jit-enable-ehβ exception handling should be enabled in the just-in-time compiler.-join-liveintervalsβ coalesce copies (default=true). she's a joiner π«Ά-nozero-initialized-in-bssβ don't place zero-initialized symbols into the BSS section. nope, not there β-pre-RA-sched=schedulerβ the instruction schedulers available (before register allocation):=default: Best scheduler for the target=none: No scheduling: breadth first sequencing=simple: Simple two pass scheduling: minimize critical path and maximize processor utilization=simple-noitin: Simple two pass scheduling: Same as simple except using generic latency=list-burr: Bottom-up register reduction list scheduling=list-tdrr: Top-down register reduction list scheduling=list-td: Top-down list scheduler
-regalloc=allocatorβ the register allocator to use (default=linearscan):=bigblock: Big-block register allocator=linearscan: linear scan register allocator=local: local register allocator=simple: simple register allocator
-relocation-model=modelβ picks the relocation model from:=default: Target default relocation model=static: Non-relocatable code=pic: Fully relocatable, position independent code=dynamic-no-pic: Relocatable external references, non-relocatable code
-spillerβ the spiller to use (default=local):=simple: simple spiller=local: local spiller
-x86-asm-syntax=syntaxβ picks the style of code emitted from the X86 backend:=att: Emit AT&T-style assembly=intel: Emit Intel-style assembly
π EXIT STATUS π
if lli fails to load the program, she'll exit with an exit code of 1. that's the sad path π
otherwise? she returns the exit code of the program she executes. she's just the messenger, fr fr π«Ά
π SEE ALSO π
llc(1) β go say hi to her sister π
πΈ AUTHOR πΈ
maintained by the LLVM Team (https://llvm.org/). iconic, they ate π
π COPYRIGHT π
2003-2023, LLVM Project
and that's the whole page bestie!! this was page version 17, dated 2023-12-01 β go forth and lli responsibly, mwah πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- opensuse-leap 16.0: llvm17 17.0.6-160000.3.1 Β· Apache-2.0 WITH LLVM-exception AND NCSA
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms