aboutsummaryrefslogtreecommitdiffstats
path: root/libyul/optimiser/Suite.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-12-06 06:42:55 +0800
committerchriseth <chris@ethereum.org>2019-01-07 21:03:32 +0800
commit2e9c70add0490a5157f393c78e29bb86f67111d7 (patch)
treeaa182a37aa5cc21be1144041ad3d6df803e9c255 /libyul/optimiser/Suite.cpp
parentaca9e581454585fab494a87febb7da3278e3aa7b (diff)
downloaddexon-solidity-2e9c70add0490a5157f393c78e29bb86f67111d7.tar.gz
dexon-solidity-2e9c70add0490a5157f393c78e29bb86f67111d7.tar.zst
dexon-solidity-2e9c70add0490a5157f393c78e29bb86f67111d7.zip
Use rematerializer if variable is unreferenced or value is "cheap".
Diffstat (limited to 'libyul/optimiser/Suite.cpp')
-rw-r--r--libyul/optimiser/Suite.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libyul/optimiser/Suite.cpp b/libyul/optimiser/Suite.cpp
index bfba8dfc..c0fd15a2 100644
--- a/libyul/optimiser/Suite.cpp
+++ b/libyul/optimiser/Suite.cpp
@@ -105,14 +105,17 @@ void OptimiserSuite::run(
RedundantAssignEliminator::run(ast);
RedundantAssignEliminator::run(ast);
UnusedPruner::runUntilStabilised(ast, reservedIdentifiers);
+ CommonSubexpressionEliminator{}(ast);
}
ExpressionJoiner::run(ast);
+ Rematerialiser::run(ast);
UnusedPruner::runUntilStabilised(ast);
ExpressionJoiner::run(ast);
UnusedPruner::runUntilStabilised(ast);
ExpressionJoiner::run(ast);
UnusedPruner::runUntilStabilised(ast);
ExpressionJoiner::run(ast);
+ Rematerialiser::run(ast);
UnusedPruner::runUntilStabilised(ast);
_ast = std::move(ast);