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

29 lines
578 B
Plaintext
Raw Permalink Normal View History

2019-11-27 09:44:40 +00:00
{
// 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
//
2019-11-27 09:44:40 +00:00
// {
// 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)
// }
// }