-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Ignore line number node when counting expressions for inlining #13553
Conversation
CI failure is #11553 .... |
CI restarted. Also cc @vtjnash, could you have a look at this please? |
it looks fine, although in general, it would be nice to be reducing the inlining threshold as that should result in slightly reduced compile times. this is likely only addressing a particular symptom of a different problem, not the actual problem. |
Hmm. I don't think I quite understand what you mean. This should only revert the inlining threshold to the old value and that's AFAIK the problem. Or do you mean that the change in inlining threshold shouldn't have such a big effect? For the test code I had above, one of the biggest problem is that
Agree if we have a way to change that locally (for SIMD) and if non-inlined function don't have a huge performance penalty because of spatting (gc frame and boxing). |
On the other hand, I would totally agree if the "actual problem" you meant is the duplicated line numbers in the function body. (only one of them would be useful anyway and they takes a lot of memory to store) |
Should we at least also try to filter out the excessive line number node? On one hand they might be useful to construct a more complete backtrace (need to extend the debug info to do that) but on the other hand, they are not really accurate either. Even the current one can still be really confusing sometimes. For example, in the following code (put
Although the error is clearly thrown from |
ok, it sounds like we should put back the line number filter, but now only remove nodes that don't match the file-name/line-numbers of the original function. or we would need to make our line number handling look more like the llvm DlInfo nodes, with explicit tracking of scope on each one. |
I guess that would help but it will probably still effectively reduce the inlining threshold by up to a factor of 2? |
it can be done in addition to this PR. the threshold computation is roughly 6 lines with an average of 16 nodes per line. |
Thanks for the comments.
I'll take this as OK to merge. I've been carrying this patch in the my julia version and for the few benchmarks I've run, it seems that the performance is back to where it should be. Will merge some sometime tomorrow if there's no objections. |
Ignore line number node when counting expressions for inlining
Feels a little like a band-aid but I think this is the right logic.
Fix #13551.