Merge pull request #9295 from ethereum/requireFLIR

Require for loop init rewriter for SSA.
This commit is contained in:
Daniel Kirchner
2020-07-04 17:51:57 +02:00
committed by GitHub
8 changed files with 49 additions and 28 deletions
+1
View File
@@ -255,6 +255,7 @@ TestCase::TestResult YulOptimizerTest::run(ostream& _stream, string const& _line
else if (m_optimizerStep == "ssaTransform")
{
disambiguate();
ForLoopInitRewriter::run(*m_context, *m_ast);
SSATransform::run(*m_context, *m_ast);
}
else if (m_optimizerStep == "redundantAssignEliminator")
@@ -0,0 +1,33 @@
{
for { let x := 0 } 1 { x := 2 } {
for { let y := 0 } 1 { y := 6 } {
}
}
}
// ----
// step: ssaTransform
//
// {
// let x_1 := 0
// let x := x_1
// for { }
// 1
// {
// let x_7 := x
// let x_2 := 2
// x := x_2
// }
// {
// let x_5 := x
// let y_3 := 0
// let y := y_3
// for { }
// 1
// {
// let y_6 := y
// let y_4 := 6
// y := y_4
// }
// { }
// }
// }
@@ -12,7 +12,8 @@
// {
// let a_1 := mload(0)
// let a := a_1
// for { mstore(0, a_1) }
// mstore(0, a_1)
// for { }
// a
// {
// let a_4 := a
@@ -12,19 +12,9 @@
// {
// let a_1 := mload(0)
// let a := a_1
// for {
// let a_2 := add(a_1, 3)
// a := a_2
// }
// a
// {
// let a_4 := a
// mstore(0, a_4)
// }
// {
// let a_3 := a
// mstore(0, a_3)
// }
// let a_5 := a
// mstore(0, a_5)
// let a_2 := add(a_1, 3)
// a := a_2
// for { } a_2 { mstore(0, a_2) }
// { mstore(0, a_2) }
// mstore(0, a_2)
// }
@@ -12,7 +12,8 @@
// {
// let a_1 := mload(0)
// let a := a_1
// for { mstore(0, a_1) }
// mstore(0, a_1)
// for { }
// a
// {
// let a_4 := a
@@ -32,10 +32,9 @@
// a := a_4
// }
// let a_10 := a
// for {
// let a_5 := add(a_10, 3)
// a := a_5
// }
// let a_5 := add(a_10, 3)
// a := a_5
// for { }
// a
// {
// let a_12 := a