aboutsummaryrefslogtreecommitdiffstats
path: root/test/libyul/yulOptimizerTests/rematerialiser/cheap_caller.yul
blob: 7e99e42893c1103ac0bc8aff6a3758cced62fdcf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
    // 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))
}
// ----
// rematerialiser
// {
//     let a := caller()
//     mstore(caller(), caller())
//     mstore(add(caller(), caller()), mload(caller()))
//     sstore(caller(), sload(caller()))
// }