diff --git a/Changelog.md b/Changelog.md index 90ebf4bad..6b92a54f2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ Compiler Features: * ABI Output: Change sorting order of functions from selector to kind, name. * Optimizer: Add rule that replaces the BYTE opcode by 0 if the first argument is larger than 31. * Yul Optimizer: Take side-effect-freeness of user-defined functions into account. + * Yul Optimizer: Remove redundant mload/sload operations. Bugfixes: diff --git a/libyul/optimiser/Suite.cpp b/libyul/optimiser/Suite.cpp index d1677bf53..ac92761d7 100644 --- a/libyul/optimiser/Suite.cpp +++ b/libyul/optimiser/Suite.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -118,6 +119,7 @@ void OptimiserSuite::run( ExpressionSimplifier::run(_dialect, ast); CommonSubexpressionEliminator::run(_dialect, ast); + LoadResolver::run(_dialect, ast); } { @@ -132,6 +134,7 @@ void OptimiserSuite::run( { // simplify again + LoadResolver::run(_dialect, ast); CommonSubexpressionEliminator::run(_dialect, ast); UnusedPruner::runUntilStabilisedOnFullAST(_dialect, ast, reservedIdentifiers); } @@ -161,6 +164,7 @@ void OptimiserSuite::run( RedundantAssignEliminator::run(_dialect, ast); RedundantAssignEliminator::run(_dialect, ast); CommonSubexpressionEliminator::run(_dialect, ast); + LoadResolver::run(_dialect, ast); } { @@ -176,6 +180,7 @@ void OptimiserSuite::run( SSATransform::run(ast, dispenser); RedundantAssignEliminator::run(_dialect, ast); RedundantAssignEliminator::run(_dialect, ast); + LoadResolver::run(_dialect, ast); ExpressionSimplifier::run(_dialect, ast); StructuralSimplifier{_dialect}(ast); BlockFlattener{}(ast);