mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added MemoryStoreRemover to the optimizer suite.
However it is not part of fullsuite, and therefore disabled by default.
This commit is contained in:
parent
f6a82f8efa
commit
6763a6bafe
10
docs/yul.rst
10
docs/yul.rst
@ -1134,6 +1134,7 @@ Abbreviation Full name
|
||||
``L`` ``LoadResolver``
|
||||
``M`` ``LoopInvariantCodeMotion``
|
||||
``r`` ``RedundantAssignEliminator``
|
||||
``S`` ``MemoryStoreRemover`` - highly experimental
|
||||
``R`` ``ReasoningBasedSimplifier`` - highly experimental
|
||||
``m`` ``Rematerialiser``
|
||||
``V`` ``SSAReverser``
|
||||
@ -1146,10 +1147,11 @@ Abbreviation Full name
|
||||
Some steps depend on properties ensured by ``BlockFlattener``, ``FunctionGrouper``, ``ForLoopInitRewriter``.
|
||||
For this reason the Yul optimizer always applies them before applying any steps supplied by the user.
|
||||
|
||||
The ReasoningBasedSimplifier is an optimizer step that is currently not enabled
|
||||
in the default set of steps. It uses an SMT solver to simplify arithmetic expressions
|
||||
and boolean conditions. It has not received thorough testing or validation yet and can produce
|
||||
non-reproducible results, so please use with care!
|
||||
The ReasoningBasedSimplifier and MemoryStoreRemover are optimizer steps that are currently not
|
||||
enabled in the default set of steps. ReasoningBasedSimplifier uses an SMT solver to simplify
|
||||
arithmetic expressions and boolean conditions. Similarly, MemoryStoreRemover uses an SMT solver to
|
||||
remove memory stores that are never read. They have not received thorough testing or validation yet
|
||||
and can produce non-reproducible results, so please use with care!
|
||||
|
||||
.. _erc20yul:
|
||||
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <libyul/optimiser/ForLoopInitRewriter.h>
|
||||
#include <libyul/optimiser/ForLoopConditionIntoBody.h>
|
||||
#include <libyul/optimiser/FunctionSpecializer.h>
|
||||
#include <libyul/optimiser/MemoryStoreRemover.h>
|
||||
#include <libyul/optimiser/ReasoningBasedSimplifier.h>
|
||||
#include <libyul/optimiser/Rematerialiser.h>
|
||||
#include <libyul/optimiser/UnusedFunctionParameterPruner.h>
|
||||
@ -199,6 +200,7 @@ map<string, unique_ptr<OptimiserStep>> const& OptimiserSuite::allSteps()
|
||||
LiteralRematerialiser,
|
||||
LoadResolver,
|
||||
LoopInvariantCodeMotion,
|
||||
MemoryStoreRemover,
|
||||
RedundantAssignEliminator,
|
||||
ReasoningBasedSimplifier,
|
||||
Rematerialiser,
|
||||
@ -239,6 +241,7 @@ map<string, char> const& OptimiserSuite::stepNameToAbbreviationMap()
|
||||
{LiteralRematerialiser::name, 'T'},
|
||||
{LoadResolver::name, 'L'},
|
||||
{LoopInvariantCodeMotion::name, 'M'},
|
||||
{MemoryStoreRemover::name, 'S'},
|
||||
{ReasoningBasedSimplifier::name, 'R'},
|
||||
{RedundantAssignEliminator::name, 'r'},
|
||||
{Rematerialiser::name, 'm'},
|
||||
|
@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(output_operator_should_create_concise_and_unambiguous_strin
|
||||
|
||||
BOOST_TEST(chromosome.length() == allSteps.size());
|
||||
BOOST_TEST(chromosome.optimisationSteps() == allSteps);
|
||||
BOOST_TEST(toString(chromosome) == "flcCUnDvejsxIOoighFTLMRrmVatpud");
|
||||
BOOST_TEST(toString(chromosome) == "flcCUnDvejsxIOoighFTLMSRrmVatpud");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(optimisationSteps_should_translate_chromosomes_genes_to_optimisation_step_names)
|
||||
|
Loading…
Reference in New Issue
Block a user