8000 gh-131798: JIT: Split CALL_STR_1 into several uops by tomasr8 · Pull Request #132849 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131798: JIT: Split CALL_STR_1 into several uops #132849

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 6 commits into from
Apr 24, 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
Prev Previous commit
Next Next commit
Simplify code
  • Loading branch information
tomasr8 committed Apr 24, 2025
commit 0a96b3a14fb8805da18a83584e02f069a2cf84cb
7 changes: 3 additions & 4 deletions Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,10 +856,9 @@ dummy_func(void) {
}

op(_CALL_STR_1, (unused, unused, arg -- res)) {
if (sym_matches_type(arg, &PyUnicode_Type) && sym_is_const(ctx, arg)) {
// e.g. str('foo') or str(foo) where foo is known to be a string const
PyObject *value = sym_get_const(ctx, arg);
res = sym_new_const(ctx, value);
if (sym_matches_type(arg, &PyUnicode_Type)) {
// e.g. str('foo') or str(foo) where foo is known to be a string
res = arg;
}
else {
res = sym_new_type(ctx, &PyUnicode_Type);
Expand Down
5 changes: 2 additions & 3 deletions Python/optimizer_cases.c.h

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

0