-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Don't inline slow path functions in the interpreter loop #132336
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
Comments
…oop as noinline (#132337) Mark a few functions used by the interpreter loop as noinline These are all the slow path and should not be inlined into the interpreter loop. Unfortunately, they end up being inlined with LTO and the current PGO task.
The |
As I understand it, |
Ah, you're right:
|
What we do or do not want to inline depends on whether it is a tail-calling build or not. For the tailcalling, many of the above function are on the hot path of the instruction they are part of. For the normal build, the size of Maybe using better profiles is the way to do this? |
This is a good point.
I think we should do both. For the non-tail-calling interpreter we should mark the specialization functions as noinline, since that's more reliable than trying to coax a black box into doing what we want. I also think we should continue marking the instrumentation and exception handling functions as noinline since we know that those should be rare / exceptional paths. |
…eter loop as noinline (python#132337) Mark a few functions used by the interpreter loop as noinline These are all the slow path and should not be inlined into the interpreter loop. Unfortunately, they end up being inlined with LTO and the current PGO task.
Feature or enhancement
Proposal:
I was looking at the IPA inlining dump as part of investigating the root cause of gh-132295 and noticed that we're inlining a number of slow path functions related to specialization, instrumentation, and error handling in the interpreter loop when performing LTO (full list here):
I suspect these are being inlined because we use unit tests for collecting PGO data. These should be executed relatively infrequently for "normal" Python code. We should mark them as
noinline
.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
The text was updated successfully, but these errors were encountered: