Skip to content

Commit

Permalink
Optimizer docs: Add missing info about steps that destroy the SSA and…
Browse files Browse the repository at this point in the history
… expression-split forms
  • Loading branch information
cameel committed Apr 27, 2024
1 parent 3538780 commit 9747d70
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/internals/optimizer.rst
Expand Up @@ -466,6 +466,8 @@ Loops that already have a literal constant as iteration condition are not transf

To avoid unnecessary rewriting, it is recommended to run this step after StructuralSimplifier.

May destroy the :ref:`expression-split <expression-splitter>` form.

Prerequisites: Disambiguator.

.. _for-loop-init-rewriter:
Expand Down Expand Up @@ -881,6 +883,8 @@ Since variable references are always movable, even if their current
value might not be, the ExpressionSimplifier is again more powerful
in :ref:`expression-split <expression-splitter>` or :ref:`pseudo-SSA <ssa-transform>` form.

Some of the simplifications destroy the :ref:`expression-split <expression-splitter>` form.

Prerequisites: Disambiguator, ForLoopInitRewriter.

.. _literal-rematerialiser:
Expand All @@ -893,6 +897,8 @@ the variable with the literal.

This is mostly used so that other components do not have to rely on the DataflowAnalyzer.

Destroys the :ref:`expression-split <expression-splitter>` form.

Prerequisites: Disambiguator, ForLoopInitRewriter.

.. _load-resolver:
Expand Down Expand Up @@ -931,7 +937,7 @@ ConditionalSimplifier
The ConditionalSimplifier inserts assignments to condition variables if the value can be determined
from the control-flow.

Destroys SSA form.
Destroys the :ref:`SSA <ssa-transform>` form.

Currently, this tool is very limited, mostly because we do not yet have support
for boolean types. Since conditions only check for expressions being nonzero,
Expand Down Expand Up @@ -1386,6 +1392,8 @@ Because of that, the snippet ``let x := add(0, 2) let y := mul(x, 3)`` is
transformed to ``let y := mul(add(0, 2), 3)``, even though the ``add`` opcode
would be executed after the evaluation of the literal ``3``.

Destroys the :ref:`expression-split <expression-splitter>` form.

Prerequisites: Disambiguator.

.. _ssa-reverser:
Expand Down Expand Up @@ -1438,6 +1446,8 @@ by ``a`` (until ``a`` is re-assigned). The UnusedPruner will then
eliminate the variable ``a_1`` altogether and thus fully reverse the
SSATransform.

Destroys the :ref:`SSA <ssa-transform>` form.

Prerequisites: Disambiguator.

.. _stack-compressor:
Expand Down Expand Up @@ -1476,6 +1486,8 @@ which are always movable.
If the value is very cheap or the variable was explicitly requested to be eliminated,
the variable reference is replaced by its current value.

Destroys the :ref:`expression-split <expression-splitter>` form.

Prerequisites: Disambiguator, ForLoopInitRewriter.

.. _for-loop-condition-out-of-body:
Expand Down

0 comments on commit 9747d70

Please sign in to comment.