solidity/test/libyul/yulOptimizerTests/rematerialiser/some_refs_small_cost_nested_loop.yul
2020-01-08 09:56:08 +01:00

27 lines
494 B
Plaintext

{
// Cost of rematerializating x is 1
let x := 0xff
// Although x has a low cost and fewer than 6 references,
// its references in a loop are not rematerialized
for {} lt(x, 0x100) {}
{
let y := add(x, 1)
for {} lt(x, 0x200) {}
{
let z := mul(x, 2)
}
}
}
// ====
// step: rematerialiser
// ----
// {
// let x := 0xff
// for { } lt(x, 0x100) { }
// {
// let y := add(x, 1)
// for { } lt(x, 0x200) { }
// { let z := mul(x, 2) }
// }
// }