lli.rst 5.9 KB

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