|
72 | 72 | // sense in new pass anyhow, and things should be simpler overall to keep such
|
73 | 73 | // casts all in one pass, here.
|
74 | 74 | //
|
75 |
| -// TODO: Move casts earlier in a basic block as well, at least in traps-never- |
76 |
| -// happen mode where we can assume they never fail. |
77 |
| -// TODO: Look past individual basic blocks? |
78 |
| -// TODO: Look at LocalSet as well and not just Get. That would add some overlap |
79 |
| -// with the other passes mentioned above, but once we do things like |
80 |
| -// moving casts earlier as in the other TODO, we'd be doing uniquely |
81 |
| -// useful things with LocalSet here. |
| 75 | +// TODO: 1. Move casts earlier in a basic block as well, at least in |
| 76 | +// traps-never-happen mode where we can assume they never fail, and |
| 77 | +// perhaps in other situations too. |
| 78 | +// TODO: 2. Look past individual basic blocks? This may be worth considering |
| 79 | +// given the pattern of a cast appearing in an if condition that is |
| 80 | +// then used in an if arm, for example, where simple dominance shows |
| 81 | +// the cast can be reused. |
| 82 | +// TODO: 3. Look at LocalSet as well and not just Get. That would add some |
| 83 | +// overlap with the other passes mentioned above (SimplifyLocals and |
| 84 | +// RedundantSetElimination also track sets and can switch a get to use |
| 85 | +// a better set's index when that refines the type). But once we do the |
| 86 | +// first two TODOs above then we'd be adding some novel things here, |
| 87 | +// as we could optimize "backwards" as well (TODO 1) and past basic |
| 88 | +// blocks (TODO 2, though RedundantSetElimination does that as well). |
| 89 | +// However, we should consider whether improving those other passes |
| 90 | +// might make more sense (as it would help more than casts, if we could |
| 91 | +// make them operate "backwards" and/or past basic blocks). |
82 | 92 | //
|
83 | 93 |
|
84 | 94 | #include "ir/linear-execution.h"
|
|
0 commit comments