-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-143421: Use new buffer to save optimized uops #143682
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
base: main
Are you sure you want to change the base?
Conversation
|
@Fidget-Spinner There may be many details that need fixing, and I hope you can give me some suggestions. |
|
I haven't yet removed the cases of cpython/Python/optimizer_analysis.c Line 244 in 03e6457
|
Fidget-Spinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is really valuable work. We definitely need this.
Python/optimizer_analysis.c
Outdated
| int last_opcode = ctx->out_buffer[ctx->out_len - 1].opcode; | ||
| if (last_opcode != _EXIT_TRACE && | ||
| last_opcode != _JUMP_TO_TOP && | ||
| last_opcode != _DYNAMIC_EXIT && | ||
| last_opcode != _DEOPT) { | ||
| return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use is_terminator.
Also, instead of return 0, you should insert an _EXIT_TRACE there pointing to the current target.
|
|
||
| op(_GUARD_TOS_INT, (value -- value)) { | ||
| if (sym_is_compact_int(value)) { | ||
| REPLACE_OP(this_instr, _NOP, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these REPLACE_OP should be left untouched. As you already have a mechanism to copy over the current op if there's no ADD_OP called right :) ?
| bool insert_mode) | ||
| { | ||
| if (sym_matches_type(value, &PyBool_Type)) { | ||
| REPLACE_OP(this_instr, _NOP, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these REPLACE_OP should be left untouched as well. They should stay the same.
|
Thanks for taking the time to review this! I will rewrite them later. |
Uh oh!
There was an error while loading. Please reload this page.