-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix ExistentialSpecializer to correctly cleanup storage. #25038
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
Conversation
Minor drive-by fix. Use best practice when generating debug locations. Use the scope and location from the insertion point. But since we can't attach a return location to a normal instruction, use a compiler generated placeholder.
This option no longer works but was still in the option file and help message. Add a temporary pass-specific option instead for debugging until this pass has been sufficiently tested yet.
Factor the code a bit and follow some best practices so that it's easier for me to work with in preparation for a bug fix.
This reindented a lot of the code. It only ran on the function that I modified.
Handle calling conventions and cleanups in all the places (hopefully). - when ExistentialSpecializer copies the specialized concrete arg into the original existential value - when ExistentialSpecializer generates a think - when SILCombine substitutes concrete values in place of the opened existential. One particularly nasty problem is the existential boxes need to be destroyed. It is not ok to simply destroy their value. The "leaks" tool does not catch this problem. Ownership SIL will make this all much more robust. Fixes <rdar://problem/50595630> Multiple leaks detected - Swift Perf
@swift-ci test. |
@swift-ci test source compatibility |
@swift-ci benchmark |
Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
How to read the dataThe tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.If you see any unexpected regressions, you should consider fixing the Noise: Sometimes the performance results (not code size!) contain false Hardware Overview
|
I cannot reproduce the SortLargeExistentials regression locally. It only showed up in Osize which usually indicates something wasn't inlined. @rajbarik will you have a chance to review these changes? |
@atrick Sorry, I got sidetracked with something and did not see the email until now. I will have a look at it today. |
Handle calling conventions and cleanups in all the places (hopefully).
original existential value
existential.
One particularly nasty problem is the existential boxes need to be
destroyed. It is not ok to simply destroy their value. The "leaks"
tool does not catch this problem.
Ownership SIL will make this all much more robust.
Fixes rdar://problem/50595630 Multiple leaks detected - Swift Perf