solidity/test/libyul/yulOptimizerTests/rematerialiser/for_continue_2.yul

44 lines
781 B
Plaintext
Raw Normal View History

{
let a
let b
let c
let i := 0
for { }
lt(i, 10)
{ i := add(add(a, b), c) } // `b` is always known to be caller() but `a` and `c` may be origin() or caller().
{
a := origin()
b := origin()
c := origin()
b := caller()
if callvalue() { continue }
a := caller()
if callvalue() { continue }
c := caller()
}
mstore(a, b)
}
2019-04-01 14:33:46 +00:00
// ====
// step: rematerialiser
// ----
// {
// let a
// let b
// let c
// let i := 0
// for { } lt(i, 10) { i := add(add(a, caller()), c) }
// {
// a := origin()
// b := origin()
// c := origin()
// b := caller()
// if callvalue() { continue }
// a := caller()
// if callvalue() { continue }
// c := caller()
// }
// mstore(a, b)
// }