Changelog and docs

This commit is contained in:
Nikola Matic 2022-08-12 12:51:16 +02:00
parent f6f0d6a360
commit ddf0d784ac
7 changed files with 22 additions and 10 deletions

View File

@ -4,7 +4,7 @@ Language Features:
Compiler Features: Compiler Features:
* Yul Optimizer: Allow replacing the previously hard-coded cleanup sequence by specifying custom steps after a colon delimiter (`:`) in the sequence string.
Bugfixes: Bugfixes:
@ -21,7 +21,7 @@ Compiler Features:
* Yul Optimizer: Simplify the starting offset of zero-length operations to zero. * Yul Optimizer: Simplify the starting offset of zero-length operations to zero.
Bugfixes: Bugfixes:`````
* Type Checker: Fix internal compiler error on tuple assignments with invalid left-hand side. * Type Checker: Fix internal compiler error on tuple assignments with invalid left-hand side.
* Yul IR Code Generation: Fix internal compiler error when accessing the ``.slot`` member of a mapping through a storage reference in inline assembly. * Yul IR Code Generation: Fix internal compiler error when accessing the ``.slot`` member of a mapping through a storage reference in inline assembly.

View File

@ -329,11 +329,15 @@ the ``--yul-optimizations`` option:
.. code-block:: bash .. code-block:: bash
solc --optimize --ir-optimized --yul-optimizations 'dhfoD[xarrscLMcCTU]uljmul' solc --optimize --ir-optimized --yul-optimizations 'dhfoD[xarrscLMcCTU]uljmul:fDnTOc'
The sequence inside ``[...]`` will be applied multiple times in a loop until the Yul code The sequence inside ``[...]`` will be applied multiple times in a loop until the Yul code
remains unchanged or until the maximum number of rounds (currently 12) has been reached. remains unchanged or until the maximum number of rounds (currently 12) has been reached.
The colon delimiter ``:`` is used to supply a custom clean up sequence in order to replace the
default (``fDnTOc``) one, which is run after the stack compressor when using the legacy EVM
code transform.
Available abbreviations are listed in the :ref:`Yul optimizer docs <optimization-step-sequence>`. Available abbreviations are listed in the :ref:`Yul optimizer docs <optimization-step-sequence>`.
Preprocessing Preprocessing

View File

@ -1250,7 +1250,7 @@ You can override this sequence and supply your own using the ``--yul-optimizatio
.. code-block:: sh .. code-block:: sh
solc --optimize --ir-optimized --yul-optimizations 'dhfoD[xarrscLMcCTU]uljmul' solc --optimize --ir-optimized --yul-optimizations 'dhfoD[xarrscLMcCTU]uljmul:fDnTOc'
The order of steps is significant and affects the quality of the output. The order of steps is significant and affects the quality of the output.
Moreover, applying a step may uncover new optimization opportunities for others that were already Moreover, applying a step may uncover new optimization opportunities for others that were already
@ -1259,6 +1259,12 @@ By enclosing part of the sequence in square brackets (``[]``) you tell the optim
apply that part until it no longer improves the size of the resulting assembly. apply that part until it no longer improves the size of the resulting assembly.
You can use brackets multiple times in a single sequence but they cannot be nested. You can use brackets multiple times in a single sequence but they cannot be nested.
The colon delimiter (``:``) in the example is used to specify a custom cleanup sequence, which is run after
the main part of the sequence before the delimiter (and, when using the legacy EVM code transform,
only *after* the stack compressor). If no such delimiter is present, the default cleanup sequence (``fDnTOc``)
is run after the supplied sequence.
The following optimization steps are available: The following optimization steps are available:
============ =============================== ============ ===============================

View File

@ -7,6 +7,7 @@ contract C {
assembly ("memory-safe") { assembly ("memory-safe") {
let a := 0 let a := 0
revert(0, a) revert(0, a)
// Without the cleanup sequence this will not be simplified to ``revert(a, a)``.
} }
} }
} }

View File

@ -3,9 +3,9 @@ Optimized IR:
object "C_8" { object "C_8" {
code { code {
{ {
/// @src 0:80:221 "contract C {..." /// @src 0:80:314 "contract C {..."
mstore(64, memoryguard(0x80)) mstore(64, memoryguard(0x80))
/// @src 0:129:213 "assembly (\"memory-safe\") {..." /// @src 0:129:306 "assembly (\"memory-safe\") {..."
let usr$a := 0 let usr$a := 0
revert(0, usr$a) revert(0, usr$a)
} }
@ -14,7 +14,7 @@ object "C_8" {
object "C_8_deployed" { object "C_8_deployed" {
code { code {
{ {
/// @src 0:80:221 "contract C {..." /// @src 0:80:314 "contract C {..."
mstore(64, memoryguard(0x80)) mstore(64, memoryguard(0x80))
revert(0, 0) revert(0, 0)
} }

View File

@ -7,6 +7,7 @@ contract C {
assembly ("memory-safe") { assembly ("memory-safe") {
let a := 0 let a := 0
revert(0, a) revert(0, a)
// Without the cleanup sequence this will not be simplified to ``revert(a, a)``.
} }
} }
} }

View File

@ -3,9 +3,9 @@ Optimized IR:
object "C_8" { object "C_8" {
code { code {
{ {
/// @src 0:80:221 "contract C {..." /// @src 0:80:314 "contract C {..."
mstore(64, memoryguard(0x80)) mstore(64, memoryguard(0x80))
/// @src 0:129:213 "assembly (\"memory-safe\") {..." /// @src 0:129:306 "assembly (\"memory-safe\") {..."
let usr$a := 0 let usr$a := 0
revert(0, usr$a) revert(0, usr$a)
} }
@ -14,7 +14,7 @@ object "C_8" {
object "C_8_deployed" { object "C_8_deployed" {
code { code {
{ {
/// @src 0:80:221 "contract C {..." /// @src 0:80:314 "contract C {..."
mstore(64, memoryguard(0x80)) mstore(64, memoryguard(0x80))
revert(0, 0) revert(0, 0)
} }