-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[semantic-arc-opts] Change to always use the worklist. #27430
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
[semantic-arc-opts] Change to always use the worklist. #27430
Conversation
@swift-ci smoke test |
9251a62
to
b2b663e
Compare
@swift-ci smoke test |
4 similar comments
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
I am fixing the outliner bug. The problem is that I am eliminating an extra release breaking the pattern matching. My solution is to just teach the outliner that if it doesn't have that missing release that it should make an outlined function with a guaranteed parameter. |
91deeb7
to
90e9e01
Compare
@swift-ci test |
@swift-ci benchmark |
Build failed |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow 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
|
20% improvement to NSString -> Swift String -> NSString conversion round trips :) nice! |
Was just thinking about the outliner change here. Fundamentally without the release that we were peepholing before, outlining like this is not safe. That being said, I have a solution: outline with a coroutine. This will let me keep the original initial conversion in the same spot and not have to worry about lifetime extending inappropriately. |
I talked with Arnold about the outliner thing. I am going to change the bridge argument code to handle this case with additional safety. |
I am going to split out the outliner change into another PR. |
Actually, I am going to put this down for a little bit. |
Redoing the testing here. |
@swift-ci test |
@swift-ci benchmark |
mmm... I forgot about that outliner issue. |
Build failed |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow 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
|
Build failed |
I took a bit of a closer look at this. The code pattern that we are looking at is:
From what I am reading in the code, we do not find the release_value of %14 due to better optimization. In such a case since we are going to use %14 in a guaranteed way anyways, we can just pass %14 as a guaranteed parameter without worry. |
90e9e01
to
934806d
Compare
@swift-ci test |
@swift-ci test source compatibility |
1 similar comment
@swift-ci test source compatibility |
@swift-ci benchmark |
1 similar comment
@swift-ci benchmark |
Build failed |
Build failed |
Performance: -O
Code size: -OPerformance: -Osize
Code size: -OsizePerformance: -Onone
Code size: -swiftlibsHow 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
|
…hey can only match one function uniquely.
…do not find a release.
Previously we were: 1. Doing a linear scan, performing certain optimizations, and setting up a worklist for future processing. 2. Draining the worklist of changed instructions until we reached a fix point. The key thing here is that for (1) to be safe, we would need to not perform any optimizations on block arguments since there was an ssumption that we would only perform SSA-like optimizations. I am going to be adding such optimizations soon, so it makes sense to just convert the initial traversal to non-destructively seed the worklist and eliminate that initial optimization pass. This should be NFC.
934806d
to
67ff2ae
Compare
@swift-ci test |
1 similar comment
@swift-ci test |
Build failed |
Build failed |
The only regression I could reproduce is LazilyFilteredArrayContains. The rest are noise. |
In terms of improvements, I am seeing that all are real improvements except for static array. |
I think the difference in that lazy benchmark is a weird cache effect. The reason why I am pretty confidant of this is that:
I.e. some constant is offset by 16. I wonder if we need to do something to fix the alignment of globals. Not sure. |
Previously we were:
Doing a linear scan, performing certain optimizations, and setting up a
worklist for future processing.
Draining the worklist of changed instructions until we reached a fix point.
The key thing here is that for (1) to be safe, we would need to not perform any
optimizations on block arguments since there was an ssumption that we would only
perform SSA-like optimizations.
I am going to be adding such optimizations soon, so it makes sense to just
convert the initial traversal to non-destructively seed the worklist and
eliminate that initial optimization pass.
This should be NFC.