brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.4 KiB · ffcccfb Raw
227 lines · plain
1llc - LLVM static compiler2==========================3 4.. program:: llc5 6SYNOPSIS7--------8 9:program:`llc` [*options*] [*filename*]10 11DESCRIPTION12-----------13 14The :program:`llc` command compiles LLVM source inputs into assembly language15for a specified architecture.  The assembly language output can then be passed16through a native assembler and linker to generate a native executable.17 18The choice of architecture for the output assembly code is automatically19determined from the input file, unless the :option:`-march` option is used to20override the default.21 22OPTIONS23-------24 25If ``filename`` is "``-``" or omitted, :program:`llc` reads from standard input.26Otherwise, it will read from ``filename``.  Inputs can be in either the LLVM27assembly language format (``.ll``) or the LLVM bitcode format (``.bc``).28 29If the :option:`-o` option is omitted, then :program:`llc` will send its output30to standard output if the input is from standard input.  If the :option:`-o`31option specifies "``-``", then the output will also be sent to standard output.32 33If no :option:`-o` option is specified and an input file other than "``-``" is34specified, then :program:`llc` creates the output filename by taking the input35filename, removing any existing ``.bc`` extension, and adding a ``.s`` suffix.36 37Other :program:`llc` options are described below.38 39End-user Options40~~~~~~~~~~~~~~~~41 42.. option:: -help43 44 Print a summary of command line options.45 46.. option:: -M47 48 Pass target-specific InstPrinter options.49 Refer to the ``-M`` option of :manpage:`llvm-objdump(1)`.50 51.. option:: -o <filename>52 53 Use ``<filename>`` as the output filename. See the summary above for more54 details.55 56.. option:: -O=uint57 58 Generate code at different optimization levels.  These correspond to the59 ``-O0``, ``-O1``, ``-O2``, and ``-O3`` optimization levels used by60 :program:`clang`.61 62.. option:: -mtriple=<target triple>63 64 Override the target triple specified in the input file with the specified65 string.66 67.. option:: -march=<arch>68 69 Specify the architecture for which to generate assembly, overriding the target70 encoded in the input file.  See the output of ``llc -help`` for a list of71 valid architectures.  By default this is inferred from the target triple or72 autodetected to the current architecture.73 74.. option:: -mcpu=<cpuname>75 76 Specify a specific chip in the current architecture to generate code for.77 By default this is inferred from the target triple and autodetected to78 the current architecture.  For a list of available CPUs, use:79 80 .. code-block:: none81 82   llvm-as < /dev/null | llc -march=xyz -mcpu=help83 84.. option:: -filetype=<output file type>85 86 Specify what kind of output ``llc`` should generated.  Options are: ``asm``87 for textual assembly ( ``'.s'``), ``obj`` for native object files (``'.o'``)88 and ``null`` for not emitting anything (for performance testing).89 90 Note that not all targets support all options.91 92.. option:: -mattr=a1,+a2,-a3,...93 94 Override or control specific attributes of the target, such as whether SIMD95 operations are enabled or not.  The default set of attributes is set by the96 current CPU.  For a list of available attributes, use:97 98 .. code-block:: none99 100   llvm-as < /dev/null | llc -march=xyz -mattr=help101 102.. option:: --frame-pointer103 104 Specify effect of frame pointer elimination optimization (all,non-leaf,none).105 106.. option:: --disable-excess-fp-precision107 108 Disable optimizations that may produce excess precision for floating point.109 Note that this option can dramatically slow down code on some systems110 (e.g. X86).111 112.. option:: --enable-no-infs-fp-math113 114 Enable optimizations that assume no Inf values.115 116.. option:: --enable-no-nans-fp-math117 118 Enable optimizations that assume no NAN values.119 120.. option:: --enable-no-signed-zeros-fp-math121 122 Enable FP math optimizations that assume the sign of 0 is insignificant.123 124.. option:: --enable-no-trapping-fp-math125 126 Enable setting the FP exceptions build attribute not to use exceptions.127 128.. option:: --stats129 130 Print statistics recorded by code-generation passes.131 132.. option:: --save-stats, --save-stats=cwd, --save-stats=obj133 134 Save LLVM statistics to a file in the current directory135 (:option:`--save-stats`/"--save-stats=cwd") or the directory136 of the output file ("--save-stats=obj") in JSON format.137 138.. option:: --time-passes139 140 Record the amount of time needed for each pass and print a report to standard141 error.142 143.. option:: --load=<dso_path>144 145 Dynamically load ``dso_path`` (a path to a dynamically shared object) that146 implements an LLVM target.  This will permit the target name to be used with147 the :option:`-march` option so that code can be generated for that target.148 149.. option:: -meabi=[default|gnu|4|5]150 151 Specify which EABI version should conform to.  Valid EABI versions are *gnu*,152 *4* and *5*.  Default value (*default*) depends on the triple.153 154.. option:: -stack-size-section155 156 Emit the .stack_sizes section which contains stack size metadata. The section157 contains an array of pairs of function symbol values (pointer size) and stack158 sizes (unsigned LEB128). The stack size values only include the space allocated159 in the function prologue. Functions with dynamic stack allocations are not160 included.161 162.. option:: -remarks-section163 164 Emit the __remarks (MachO) section which contains metadata about remark165 diagnostics.166 167Tuning/Configuration Options168~~~~~~~~~~~~~~~~~~~~~~~~~~~~169 170.. option:: --print-after-isel171 172 Print generated machine code after instruction selection (useful for debugging).173 174.. option:: --regalloc=<allocator>175 176 Specify the register allocator to use.177 Valid register allocators are:178 179 *basic*180 181  Basic register allocator.182 183 *fast*184 185  Fast register allocator. It is the default for unoptimized code.186 187 *greedy*188 189  Greedy register allocator. It is the default for optimized code.190 191 *pbqp*192 193  Register allocator based on 'Partitioned Boolean Quadratic Programming'.194 195.. option:: --spiller=<spiller>196 197 Specify the spiller to use for register allocators that support it.  Currently198 this option is used only by the linear scan register allocator.  The default199 ``spiller`` is *local*.  Valid spillers are:200 201 *simple*202 203  Simple spiller204 205 *local*206 207  Local spiller208 209Intel IA-32-specific Options210~~~~~~~~~~~~~~~~~~~~~~~~~~~~211 212.. option:: --x86-asm-syntax=[att|intel]213 214 Specify whether to emit assembly code in AT&T syntax (the default) or Intel215 syntax.216 217EXIT STATUS218-----------219 220If :program:`llc` succeeds, it will exit with 0.  Otherwise, if an error221occurs, it will exit with a non-zero value.222 223SEE ALSO224--------225 226:manpage:`lli(1)`227