-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DNM] disable assign/partial store as a test. #21918
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
[DNM] disable assign/partial store as a test. #21918
Conversation
@swift-ci smoke benchmark |
Build comment file:Performance: -O
Code size: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
Code size: -swiftlibs
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
|
4c858de
to
85ee34f
Compare
@swift-ci smoke benchmark |
@swift-ci test |
Build failed |
Build failed |
Build failed |
Build comment file:Performance: -Onone
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
|
… stops allocations from being removed. PartialStore and Assign in PMO today both are allowed and do not prevent an allocation from being removed. This is incorrect with ownership since in both cases if we have a non-trivial type, we would need to make sure that the value being overwritten is destroyed. Clearly, with ownership given that we do not know how to handle assigns in the aforementioned way, we can not remove allocation with ownership. When I make the optimization more conservative by changing assigns to stop allocations from being removed, I see no difference in the tests/benchmarks/etc. So it makes sense to make the change now. The reason to remove PartialStore is that: 1. It is actually a vestigal remnant of Definite Init code in Predictable Mem Opts. If you look in Definite Init, understanding PartialStores is a very important part of the algorithm for diagnosing partially initialized memory locations. In Predictable Mem Opts it only controlled whether or not we could eliminate an allocation. 2. PartialStore assumes that values are always initialized completely so a partial store must be an assign. Despite that the two places it was used in the code was a place where we assumed that SILGen was always going to always have an init anyways (meaning we produced a partial store without need) or in a case where if we do not have an init, we can just treat it like an assign (the copy_addr) case.
85ee34f
to
99d86f5
Compare
…ign of the dest rather than like a non-trivial type. PMO uses InitOrAssign for trivially typed things and Init/Assign for non-trivial things, so I think this was an oversight from a long time ago. There is actually no /real/ effect on the code today since after exploding the copy_addr, the store will still be used to produce the right available value and since for stores, init/assign/initorassign all result in allocations being removed. Once though I change assign to not allow for allocation removal (the proper way to model this), without this change, certain trivial allocations will no longer be removed, harming perf as seen via the benchmarking run on the bots in swiftlang#21918.
Closing this. It served its purpose. |
Just a test.