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

18 lines
392 B
Plaintext
Raw Normal View History

{
// The caller opcode is cheap, so inline it,
// no matter how often it is used
let a := caller()
mstore(a, a)
mstore(add(a, a), mload(a))
sstore(a, sload(a))
}
2019-04-01 14:33:46 +00:00
// ====
// step: rematerialiser
// ----
// {
// let a := caller()
// mstore(caller(), caller())
// mstore(add(caller(), caller()), mload(caller()))
// sstore(caller(), sload(caller()))
// }