diff --git a/docs/yul.rst b/docs/yul.rst index dbca676c9..856707320 100644 --- a/docs/yul.rst +++ b/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: diff --git a/libyul/optimiser/Suite.cpp b/libyul/optimiser/Suite.cpp index 8f676e335..4693d6640 100644 --- a/libyul/optimiser/Suite.cpp +++ b/libyul/optimiser/Suite.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -199,6 +200,7 @@ map> const& OptimiserSuite::allSteps() LiteralRematerialiser, LoadResolver, LoopInvariantCodeMotion, + MemoryStoreRemover, RedundantAssignEliminator, ReasoningBasedSimplifier, Rematerialiser, @@ -239,6 +241,7 @@ map const& OptimiserSuite::stepNameToAbbreviationMap() {LiteralRematerialiser::name, 'T'}, {LoadResolver::name, 'L'}, {LoopInvariantCodeMotion::name, 'M'}, + {MemoryStoreRemover::name, 'S'}, {ReasoningBasedSimplifier::name, 'R'}, {RedundantAssignEliminator::name, 'r'}, {Rematerialiser::name, 'm'}, diff --git a/test/yulPhaser/Chromosome.cpp b/test/yulPhaser/Chromosome.cpp index 55bfd8f24..049f98a0a 100644 --- a/test/yulPhaser/Chromosome.cpp +++ b/test/yulPhaser/Chromosome.cpp @@ -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)