forked from OSchip/llvm-project
[docs] Replace `opt -analyze` with better alternatives.
`opt -analyze` is legacy PM-specific. Show better ways of doing the same thing, generally with some sort of `-passes=print<foo>`. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D119486
This commit is contained in:
parent
4ef02cba2e
commit
2fa87ab524
|
@ -11,23 +11,12 @@ SYNOPSIS
|
|||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
The :program:`opt` command is the modular LLVM optimizer and analyzer. It
|
||||
takes LLVM source files as input, runs the specified optimizations or analyses
|
||||
on it, and then outputs the optimized file or the analysis results. The
|
||||
function of :program:`opt` depends on whether the `-analyze` option is
|
||||
given.
|
||||
|
||||
When `-analyze` is specified, :program:`opt` performs various analyses
|
||||
of the input source. It will usually print the results on standard output, but
|
||||
in a few cases, it will print output to standard error or generate a file with
|
||||
the analysis output, which is usually done when the output is meant for another
|
||||
program.
|
||||
|
||||
While `-analyze` is *not* given, :program:`opt` attempts to produce an
|
||||
optimized output file. The optimizations available via :program:`opt` depend
|
||||
upon what libraries were linked into it as well as any additional libraries
|
||||
that have been loaded with the :option:`-load` option. Use the :option:`-help`
|
||||
option to determine what optimizations you can use.
|
||||
The :program:`opt` command is the modular LLVM optimizer and analyzer. It takes
|
||||
LLVM source files as input, runs the specified optimizations or analyses on it,
|
||||
and then outputs the optimized file. The optimizations available via
|
||||
:program:`opt` depend upon what libraries were linked into it as well as any
|
||||
additional libraries that have been loaded with the :option:`-load` option. Use
|
||||
the :option:`-help` option to determine what optimizations you can use.
|
||||
|
||||
If ``filename`` is omitted from the command line or is "``-``", :program:`opt`
|
||||
reads its input from standard input. Inputs can be in either the LLVM assembly
|
||||
|
|
|
@ -87,7 +87,7 @@ same node. :ref:`loopinfo` reports this as:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
$ opt input.ll -loops -analyze
|
||||
$ opt input.ll -passes='print<loops>'
|
||||
Loop at depth 1 containing: %for.body<header><latch><exiting>
|
||||
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ assertions:
|
|||
.. code-block:: none
|
||||
|
||||
update_analyze_test_checks.py
|
||||
opt --analyze --costmodel
|
||||
opt -passes='print<cost-model>'
|
||||
|
||||
update_cc_test_checks.py
|
||||
C/C++, or clang/clang++ (IR checks)
|
||||
|
|
|
@ -214,7 +214,7 @@ Kaleidoscope looks like this:
|
|||
|
||||
To visualize the control flow graph, you can use a nifty feature of the
|
||||
LLVM '`opt <https://llvm.org/cmds/opt.html>`_' tool. If you put this LLVM
|
||||
IR into "t.ll" and run "``llvm-as < t.ll | opt -analyze -view-cfg``", `a
|
||||
IR into "t.ll" and run "``llvm-as < t.ll | opt -passes=view-cfg``", `a
|
||||
window will pop up <../../ProgrammersManual.html#viewing-graphs-while-debugging-code>`_ and you'll
|
||||
see this graph:
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ public:
|
|||
///
|
||||
/// You can obtain more examples by either calling
|
||||
///
|
||||
/// <tt> "opt -regions -analyze anyprogram.ll" </tt>
|
||||
/// <tt> "opt -passes='print<regions>' anyprogram.ll" </tt>
|
||||
/// or
|
||||
/// <tt> "opt -view-regions-only anyprogram.ll" </tt>
|
||||
///
|
||||
|
|
|
@ -14,7 +14,7 @@ Workflow:
|
|||
in regression test files.
|
||||
2. Save the patch and revert it from your local work area.
|
||||
3. Update the RUN-lines in the affected regression tests to look canonical.
|
||||
Example: "; RUN: opt < %s -analyze -cost-model -S | FileCheck %s"
|
||||
Example: "; RUN: opt < %s -passes='print<cost-model>' -disable-output 2>&1 | FileCheck %s"
|
||||
4. Refresh the FileCheck lines for either the entire file or select functions by
|
||||
running this script.
|
||||
5. Commit the fresh baseline of checks.
|
||||
|
|
Loading…
Reference in New Issue