Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

GH-115687: Most comparisons create Booleans, so propagate that information #116360

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 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
29 changes: 29 additions & 0 deletions 29 Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,35 @@ dummy_func(void) {
}
}

op(_COMPARE_OP, (left, right -- res)) {
if (oparg & 16) {
OUT_OF_SPACE_IF_NULL(res = sym_new_type(ctx, &PyBool_Type));
}
else {
OUT_OF_SPACE_IF_NULL(res = _Py_uop_sym_new_not_null(ctx));
}
}

op(_COMPARE_OP_INT, (left, right -- res)) {
OUT_OF_SPACE_IF_NULL(res = sym_new_type(ctx, &PyBool_Type));
}

op(_COMPARE_OP_FLOAT, (left, right -- res)) {
OUT_OF_SPACE_IF_NULL(res = sym_new_type(ctx, &PyBool_Type));
}

op(_COMPARE_OP_STR, (left, right -- res)) {
OUT_OF_SPACE_IF_NULL(res = sym_new_type(ctx, &PyBool_Type));
}

op(_IS_OP, (left, right -- res)) {
OUT_OF_SPACE_IF_NULL(res = sym_new_type(ctx, &PyBool_Type));
}

op(_CONTAINS_OP, (left, right -- res)) {
OUT_OF_SPACE_IF_NULL(res = sym_new_type(ctx, &PyBool_Type));
}

op(_LOAD_CONST, (-- value)) {
// There should be no LOAD_CONST. It should be all
// replaced by peephole_opt.
Expand Down
55 changes: 39 additions & 16 deletions 55 Python/optimizer_cases.c.h

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.