aboutsummaryrefslogtreecommitdiffstats
path: root/test/tools
diff options
context:
space:
mode:
authorDaniel Kirchner <daniel@ekpyron.org>2018-12-04 00:19:37 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-12-07 01:37:35 +0800
commit1eb60cbb3952df395df79ca1737f41708a658d4b (patch)
tree7c48065a0c5f14cac3f22559f5d91544020de859 /test/tools
parent4b2a64306a6b85407210245a47a7df1e0a5e0cbf (diff)
downloaddexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.tar.gz
dexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.tar.zst
dexon-solidity-1eb60cbb3952df395df79ca1737f41708a658d4b.zip
Add structural simplifier as optimization step for Yul.
Diffstat (limited to 'test/tools')
-rw-r--r--test/tools/yulopti.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/tools/yulopti.cpp b/test/tools/yulopti.cpp
index d6dbc1b1..477de42f 100644
--- a/test/tools/yulopti.cpp
+++ b/test/tools/yulopti.cpp
@@ -46,6 +46,7 @@
#include <libyul/optimiser/ExpressionJoiner.h>
#include <libyul/optimiser/RedundantAssignEliminator.h>
#include <libyul/optimiser/SSATransform.h>
+#include <libyul/optimiser/StructuralSimplifier.h>
#include <libyul/optimiser/VarDeclPropagator.h>
#include <libdevcore/JSON.h>
@@ -124,7 +125,8 @@ public:
}
cout << "(q)quit/(f)flatten/(c)se/propagate var(d)ecls/(x)plit/(j)oin/(g)rouper/(h)oister/" << endl;
cout << " (e)xpr inline/(i)nline/(s)implify/(u)nusedprune/ss(a) transform/" << endl;
- cout << " (r)edundant assign elim./re(m)aterializer/f(o)r-loop-pre-rewriter? ";
+ cout << " (r)edundant assign elim./re(m)aterializer/f(o)r-loop-pre-rewriter/" << endl;
+ cout << " s(t)ructural simplifier? " << endl;
cout.flush();
int option = readStandardInputChar();
cout << ' ' << char(option) << endl;
@@ -165,6 +167,9 @@ public:
case 's':
ExpressionSimplifier::run(*m_ast);
break;
+ case 't':
+ (StructuralSimplifier{})(*m_ast);
+ break;
case 'u':
UnusedPruner::runUntilStabilised(*m_ast);
break;