-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
gh-106290: Fix edge cases around uops #106319
Conversation
- Longer traces - Explain reason for ending a trace - Support STORE_FAST_LOAD_FAST, STORE_FAST_STORE_FAST - Add deps on pycore_uops.h
This gives us LOAD_FAST_CHECK, LOAD_CLOSURE, and DELETE_FAST.
This doesn't work right yet, alas. If an error occurs in the first uop, the lineno is -1.
The trick is that EXIT_TRACE must decrement prev_instr.
While we're cleaning up uops, maybe we should change "trace" to "superblock"? There are already several other things using the name "trace", e.g. |
This (with uops on by default) benchmarks 2% slower than main (with uops off by default). I will now revert the final (temporary) commit that turns on uops by default and mark it as ready for review. |
(I just did that to be able to benchmark it and run the tests.) This reverts commit 5b85a49.
Maybe the leak is the optimizer created and installed initially. |
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.
The code itself looks good, haven't tried running it myself or anything. Just one note:
Python/optimizer.c
Outdated
|
||
#undef ADD_TO_TRACE | ||
#undef ADD_TO_TRACE_BASIC |
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.
I don't see where this is defined...
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.
Turd from the last cleanup. I'll get rid of it, then land it.
Use it to `#undef DPRINTF` instead (which also depends on a variable in this scope).
|
A bit of an omnibus PR, alas (let me know if you want it split up). This does roughly the following (though not in that order):
SET_IP
toSAVE_IP
(per Creation of superblocks faster-cpython/ideas#558)SAVE_IP
uop at the start of the trace (ditto)unbound_local_error
; this gives us uops forLOAD_FAST_CHECK
,LOAD_CLOSURE
, andDELETE_FAST
STORE_FAST_LOAD_FAST
,STORE_FAST_STORE_FAST