Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brandtbucher merged 6 commits intopython:mainfromtomasr8:jit-call-str-1
Apr 24, 2025

Conversation

tomasr8
Copy link
Member

@tomasr8tomasr8 commentedApr 23, 2025
edited by bedevere-appbot
Loading

CALL_STR_1 is equivalent tostr(...).

Very similar to previous work on splitting upCALL_TYPE_1:#132419
This splits the instruction into a smaller instruction + 2 guards which can be optimized away. This also sets the return type tostr.

Comment on lines 859 to 863
if (sym_matches_type(arg, &PyUnicode_Type)) {
// e.g. str('foo') or str(foo) where foo is known to be a string
PyObject *value = sym_get_const(ctx, arg);
res = sym_new_const(ctx, value);
}
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is an optimization that Brandt suggested. When instr(foo),foo is known to be a string, we can propagate it to the output. I also added a test for this case.

Copy link
Member

@brandtbucherbrandtbucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Looks great! Just two suggestions:

@brandtbucherbrandtbucher merged commit0a387b3 intopython:mainApr 24, 2025
64 checks passed
@tomasr8tomasr8 deleted the jit-call-str-1 branchApril 24, 2025 19:58
@tomasr8
Copy link
MemberAuthor

Thanks for the review!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-SpinnerFidget-Spinner is a code owner

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@brandtbucherbrandtbucherAwaiting requested review from brandtbucher

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@tomasr8@brandtbucher

[8]ページ先頭

©2009-2025 Movatter.jp