solidity/test/libyul/yulOptimizerTests/commonSubexpressionEliminator/variable_for_variable.yul

28 lines
493 B
Plaintext
Raw Normal View History

2018-10-11 17:58:09 +00:00
{
let a := mload(0)
let b := add(a, 7)
let c := a
let d := c
let x := add(a, b)
// CSE has to recognize equality with x here.
let y := add(d, add(c, 7))
// some reassignments
b := mload(a)
a := b
mstore(2, a)
}
// ----
// commonSubexpressionEliminator
// {
// let a := mload(0)
// let b := add(a, 7)
// let c := a
// let d := a
// let x := add(a, b)
// let y := x
// b := mload(a)
// a := b
// mstore(2, b)
// }