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

29 lines
583 B
Plaintext

{
// Cost of rematerializating x is 1
let x := 0xff
// Although x has low cost, it is not considered for
// rematerialization because it is referenced more than 5 times
for {} lt(x, 0x100) {}
{
let y := add(x, 1)
let z := mul(x, 1)
let a := div(x, 2)
let b := mod(x, 3)
let c := sdiv(x, 4)
}
}
// ====
// step: rematerialiser
// ----
// {
// let x := 0xff
// for { } lt(x, 0x100) { }
// {
// let y := add(x, 1)
// let z := mul(x, 1)
// let a := div(x, 2)
// let b := mod(x, 3)
// let c := sdiv(x, 4)
// }
// }