-
-
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.
|
|
||
| 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 :) ?
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.
Do you mean we need the _NOP to appear in both the old buffer and the new buffer?
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.
No, you can tell the add_op function to skip if we see _NOP, and also tell the automatic add op check the same thing.
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.
No, you can tell the add_op function to skip if we see _NOP, and also tell the automatic add op check the same thing.
If i skip add _NOP to out_buffer in add_op, the original _GURAD_XX will be added automatically. If we use REPLACE_OP here, it will modify the original trace. So perhaps can use ADD_OP here?
| 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.