Commit 8a66e9f
committed
SSA: Prefer swapping instead of shrinking followed by dupping
Previously, if a slot is desirable to be dupped, but is out of reach, we
would try to shrink the stack and then bringing it to reachable region.
However, even if it is out-of-reach for dup, it might still be in reach
for swap, so if it is safe to swap, we can do it directly.1 parent b5e2e78 commit 8a66e9f
2 files changed
Lines changed: 9 additions & 7 deletions
File tree
- libyul/backends/evm/ssa
- test/libyul/ssa/stackShuffler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
350 | 356 | | |
351 | 357 | | |
352 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
19 | 15 | | |
20 | 16 | | |
0 commit comments