mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Changelog and docs
This commit is contained in:
parent
f6f0d6a360
commit
ddf0d784ac
@ -4,7 +4,7 @@ Language 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:
|
||||
|
||||
@ -21,7 +21,7 @@ Compiler Features:
|
||||
* 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.
|
||||
* Yul IR Code Generation: Fix internal compiler error when accessing the ``.slot`` member of a mapping through a storage reference in inline assembly.
|
||||
|
||||
|
@ -329,11 +329,15 @@ the ``--yul-optimizations`` option:
|
||||
|
||||
.. 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
|
||||
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>`.
|
||||
|
||||
Preprocessing
|
||||
|
@ -1250,7 +1250,7 @@ You can override this sequence and supply your own using the ``--yul-optimizatio
|
||||
|
||||
.. 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.
|
||||
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.
|
||||
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:
|
||||
|
||||
============ ===============================
|
||||
|
@ -7,6 +7,7 @@ contract C {
|
||||
assembly ("memory-safe") {
|
||||
let a := 0
|
||||
revert(0, a)
|
||||
// Without the cleanup sequence this will not be simplified to ``revert(a, a)``.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ Optimized IR:
|
||||
object "C_8" {
|
||||
code {
|
||||
{
|
||||
/// @src 0:80:221 "contract C {..."
|
||||
/// @src 0:80:314 "contract C {..."
|
||||
mstore(64, memoryguard(0x80))
|
||||
/// @src 0:129:213 "assembly (\"memory-safe\") {..."
|
||||
/// @src 0:129:306 "assembly (\"memory-safe\") {..."
|
||||
let usr$a := 0
|
||||
revert(0, usr$a)
|
||||
}
|
||||
@ -14,7 +14,7 @@ object "C_8" {
|
||||
object "C_8_deployed" {
|
||||
code {
|
||||
{
|
||||
/// @src 0:80:221 "contract C {..."
|
||||
/// @src 0:80:314 "contract C {..."
|
||||
mstore(64, memoryguard(0x80))
|
||||
revert(0, 0)
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ contract C {
|
||||
assembly ("memory-safe") {
|
||||
let a := 0
|
||||
revert(0, a)
|
||||
// Without the cleanup sequence this will not be simplified to ``revert(a, a)``.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@ Optimized IR:
|
||||
object "C_8" {
|
||||
code {
|
||||
{
|
||||
/// @src 0:80:221 "contract C {..."
|
||||
/// @src 0:80:314 "contract C {..."
|
||||
mstore(64, memoryguard(0x80))
|
||||
/// @src 0:129:213 "assembly (\"memory-safe\") {..."
|
||||
/// @src 0:129:306 "assembly (\"memory-safe\") {..."
|
||||
let usr$a := 0
|
||||
revert(0, usr$a)
|
||||
}
|
||||
@ -14,7 +14,7 @@ object "C_8" {
|
||||
object "C_8_deployed" {
|
||||
code {
|
||||
{
|
||||
/// @src 0:80:221 "contract C {..."
|
||||
/// @src 0:80:314 "contract C {..."
|
||||
mstore(64, memoryguard(0x80))
|
||||
revert(0, 0)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user