lli.rst 5.9 KB

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