Commit b3f1187
committed
Bytecode parity - iter folding, break/continue line, cold inlining
- Fold a constant list iterable into a constant tuple in for-loop
iterable position, matching the CPython optimizer, and strip a
redundant LIST_TO_TUPLE immediately before GET_ITER in the IR
peephole pass.
- Emit a Nop at the break/continue source range before unwinding
so line events land on the break/continue statement instead of
the following instruction.
- Drop `propagate_disable_load_fast_borrow`; the forward propagation
was over-zealous and the per-block inheritance in `new_block` plus
the bare-except marker are enough.
- Relax `inline_small_or_no_lineno_blocks` so small exit blocks at
the tail of a cold block are always inlined, not just return
epilogues.
- Add codegen tests covering the LIST_TO_TUPLE/GET_ITER peephole and
the late-CFG trace helper for a for-loop list-literal iterable.1 parent 7a6db47 commit b3f1187
14 files changed
Lines changed: 1644 additions & 494 deletions
File tree
- Lib/test
- crates
- codegen/src
- snapshots
- vm/src
- stdlib/_ctypes
- types
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | | - | |
1088 | 1087 | | |
1089 | 1088 | | |
1090 | 1089 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | 307 | | |
309 | 308 | | |
310 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1957 | 1957 | | |
1958 | 1958 | | |
1959 | 1959 | | |
1960 | | - | |
1961 | | - | |
1962 | 1960 | | |
1963 | 1961 | | |
1964 | 1962 | | |
| |||
1967 | 1965 | | |
1968 | 1966 | | |
1969 | 1967 | | |
1970 | | - | |
1971 | | - | |
1972 | 1968 | | |
1973 | 1969 | | |
1974 | 1970 | | |
| |||
0 commit comments