aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/Suite.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libyul/optimiser/Suite.cpp')
-rw-r--r--libyul/optimiser/Suite.cpp71
1 files changed, 36 insertions, 35 deletions
diff --git a/libyul/optimiser/Suite.cpp b/libyul/optimiser/Suite.cpp
index c0fd15a2..9b6e1337 100644
--- a/libyul/optimiser/Suite.cpp
+++ b/libyul/optimiser/Suite.cpp
@@ -47,6 +47,7 @@ using namespace dev;
using namespace yul;
void OptimiserSuite::run(
+ Dialect const& _dialect,
Block& _ast,
AsmAnalysisInfo const& _analysisInfo,
set<YulString> const& _externallyUsedIdentifiers
@@ -54,69 +55,69 @@ void OptimiserSuite::run(
{
set<YulString> reservedIdentifiers = _externallyUsedIdentifiers;
- Block ast = boost::get<Block>(Disambiguator(_analysisInfo, reservedIdentifiers)(_ast));
+ Block ast = boost::get<Block>(Disambiguator(_dialect, _analysisInfo, reservedIdentifiers)(_ast));
(VarDeclInitializer{})(ast);
(FunctionHoister{})(ast);
(FunctionGrouper{})(ast);
(ForLoopInitRewriter{})(ast);
- StructuralSimplifier{}(ast);
+ StructuralSimplifier{_dialect}(ast);
- NameDispenser dispenser{ast};
+ NameDispenser dispenser{_dialect, ast};
for (size_t i = 0; i < 4; i++)
{
ExpressionSplitter{dispenser}(ast);
SSATransform::run(ast, dispenser);
- RedundantAssignEliminator::run(ast);
- RedundantAssignEliminator::run(ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ RedundantAssignEliminator::run(_dialect, ast);
- CommonSubexpressionEliminator{}(ast);
- ExpressionSimplifier::run(ast);
- StructuralSimplifier{}(ast);
+ CommonSubexpressionEliminator{_dialect}(ast);
+ ExpressionSimplifier::run(_dialect, ast);
+ StructuralSimplifier{_dialect}(ast);
SSATransform::run(ast, dispenser);
- RedundantAssignEliminator::run(ast);
- RedundantAssignEliminator::run(ast);
- UnusedPruner::runUntilStabilised(ast, reservedIdentifiers);
- CommonSubexpressionEliminator{}(ast);
- UnusedPruner::runUntilStabilised(ast, reservedIdentifiers);
+ RedundantAssignEliminator::run(_dialect, ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ UnusedPruner::runUntilStabilised(_dialect, ast, reservedIdentifiers);
+ CommonSubexpressionEliminator{_dialect}(ast);
+ UnusedPruner::runUntilStabilised(_dialect, ast, reservedIdentifiers);
SSATransform::run(ast, dispenser);
- RedundantAssignEliminator::run(ast);
- RedundantAssignEliminator::run(ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ RedundantAssignEliminator::run(_dialect, ast);
ExpressionJoiner::run(ast);
ExpressionJoiner::run(ast);
- ExpressionInliner(ast).run();
- UnusedPruner::runUntilStabilised(ast);
+ ExpressionInliner(_dialect, ast).run();
+ UnusedPruner::runUntilStabilised(_dialect, ast);
ExpressionSplitter{dispenser}(ast);
SSATransform::run(ast, dispenser);
- RedundantAssignEliminator::run(ast);
- RedundantAssignEliminator::run(ast);
- CommonSubexpressionEliminator{}(ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ CommonSubexpressionEliminator{_dialect}(ast);
FullInliner{ast, dispenser}.run();
SSATransform::run(ast, dispenser);
- RedundantAssignEliminator::run(ast);
- RedundantAssignEliminator::run(ast);
- ExpressionSimplifier::run(ast);
- StructuralSimplifier{}(ast);
- CommonSubexpressionEliminator{}(ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ ExpressionSimplifier::run(_dialect, ast);
+ StructuralSimplifier{_dialect}(ast);
+ CommonSubexpressionEliminator{_dialect}(ast);
SSATransform::run(ast, dispenser);
- RedundantAssignEliminator::run(ast);
- RedundantAssignEliminator::run(ast);
- UnusedPruner::runUntilStabilised(ast, reservedIdentifiers);
- CommonSubexpressionEliminator{}(ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ RedundantAssignEliminator::run(_dialect, ast);
+ UnusedPruner::runUntilStabilised(_dialect, ast, reservedIdentifiers);
+ CommonSubexpressionEliminator{_dialect}(ast);
}
ExpressionJoiner::run(ast);
- Rematerialiser::run(ast);
- UnusedPruner::runUntilStabilised(ast);
+ Rematerialiser::run(_dialect, ast);
+ UnusedPruner::runUntilStabilised(_dialect, ast);
ExpressionJoiner::run(ast);
- UnusedPruner::runUntilStabilised(ast);
+ UnusedPruner::runUntilStabilised(_dialect, ast);
ExpressionJoiner::run(ast);
- UnusedPruner::runUntilStabilised(ast);
+ UnusedPruner::runUntilStabilised(_dialect, ast);
ExpressionJoiner::run(ast);
- Rematerialiser::run(ast);
- UnusedPruner::runUntilStabilised(ast);
+ Rematerialiser::run(_dialect, ast);
+ UnusedPruner::runUntilStabilised(_dialect, ast);
_ast = std::move(ast);
}