8000 gh-131798: Optimize `_ITER_CHECK_TUPLE` by noamcohen97 · Pull Request #134803 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131798: Optimize _ITER_CHECK_TUPLE #134803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add optimizer op
  • Loading branch information
noamcohen97 committed May 27, 2025
commit c6bdd527f13518c712a0c9bc0864c0f2eb9e9219
8000
7 changes: 7 additions & 0 deletions Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,13 @@ dummy_func(void) {
}
}

op(_ITER_CHECK_TUPLE, (iter, null_or_index -- iter, null_or_index)) {
if (sym_matches_type(iter, &PyTuple_Type)) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
sym_set_type(iter, &PyTuple_Type);
}

op(_ITER_NEXT_RANGE, (iter, null_or_index -- iter, null_or_index, next)) {
next = sym_new_type(ctx, &PyLong_Type);
}
Expand Down
69FC 6 changes: 6 additions & 0 deletions Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
0