-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[silgenpattern] Allow the initial switch value to be at +0 if it is loadable. #19988
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
[silgenpattern] Allow the initial switch value to be at +0 if it is loadable. #19988
Conversation
@swift-ci test |
@swift-ci test source compatibility |
@swift-ci smoke benchmark |
Build failed |
Build comment file:Performance: -O
Performance: -Osize
Code size: -Osize
Performance: -Onone
Code size: Swift libraries
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 regressions before you merge the PR. Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein). Hardware Overview
|
Build failed |
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.
LGTM. Clearly emitting better SIL. I feel like we'll need cast ownership optimizations eventually.
Debug reactive cocoa/reactive swift failure is already there: https://ci.swift.org/job/swift-master-source-compat-suite-debug/342/console |
…hip verification being enabled. We were missing the code-coverage needed to show this so I added some examples to test/SILGen/errors.swift. rdar://29791263
…oadable. This commit allows the initial switch subject value to be emitted at +0 if we can emit it that way. As you can imagine since we have +0 normal function arguments this should tighten up a lot of code around switches on arguments. So I got to delete a bunch of code in the tests. = ). Some things to note: 1. If the switch is given a +1 value, we will still try to let it through at +1 until we hit a part of the decision tree where previously we would need to use TakeOnSuccess. This means that +1 values that go through irrefutable patterns like tuple splitting should still be emitted at +1. 2. If we are returned an address only type without a cleanup, we copy it and pass it down at +1 like the old code. 3. I also elided the last ownership check in SILGenPattern in this commit. After this, there is only 1 specialization for ownership in the swift compiler that is in Apply emission. Thats my next target. rdar://29791263
91a7e39
to
d8243c8
Compare
Fixed the tests. |
@swift-ci smoke test and merge |
3 similar comments
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
@swift-ci smoke test and merge |
This commit allows the initial switch subject value to be emitted at +0 if we
can emit it that way. As you can imagine since we have +0 normal function
arguments this should tighten up a lot of code around switches on arguments. So
I got to delete a bunch of code in the tests. = ).
Some things to note:
If the switch is given a +1 value, we will still try to let it through at +1
until we hit a part of the decision tree where previously we would need to use
TakeOnSuccess. This means that +1 values that go through irrefutable patterns
like tuple splitting should still be emitted at +1.
If we are returned an address only type without a cleanup, we copy it and
pass it down at +1 like the old code.
I also elided the last ownership check in SILGenPattern in this commit. After
this, there is only 1 specialization for ownership in the swift compiler that is
in Apply emission. Thats my next target.
rdar://29791263
The commit to review is the last one.