-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[semantic-arc] Eliminate simple recursive copy without borrows involved. #34812
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] Eliminate simple recursive copy without borrows involved. #34812
Conversation
@swift-ci test |
@swift-ci test source compatibility |
@swift-ci smoke benchmark |
Build failed |
@gottesmm is this another workaround for not enabling CopyPropagation? Can we tag these somehow so we can remove all the ad-hoc complexity later? |
Build failed |
Build failed before running benchmark. |
This needs #34809 |
I just added the commit from 34809 on top. |
@swift-ci test |
@swift-ci smoke benchmark |
@swift-ci test source compatibility |
Performance: -O
Code size: -OPerformance: -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
|
@swift-ci test windows platform |
@swift-ci benchmark |
@atrick interesting... this one seemed to hit code-size on DropWhile.o. Thats real ARC traffic being eliminated. Also some stuff in Foundation. |
SmallVector<Operand *, 8> parentLifetimeEndingUses; | ||
for (auto *origValueUse : originalValue->getUses()) | ||
if (origValueUse->isLifetimeEnding() && | ||
!isa<OwnershipForwardingInst>(origValueUse->getUser())) |
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.
Hmm... reading this... I think what I wrote here could be made better. I think at this point, the optimization is not dealing with LiveRanges, so the right thing to do is just gather up all consuming uses of the value, ignoring forwarding.
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.
*ignoring forwarding I mean just treating forwarding insts as normal consuming instructions.
Performance: -O
Code size: -OPerformance: -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
|
4603e72
to
b9b6eea
Compare
@swift-ci smoke test |
This doesn't happen as much as the guaranteed + owned value optimization but can occur once we start eliminating borrow scopes. I noticed that I needed this when looking at the arbitrary RAUW for ownership API.
b9b6eea
to
1fd4003
Compare
Just had to mixup a merge conflict due to me landing a different PR that touched the same test. |
@swift-ci smoke test |
This doesn't happen as much as the guaranteed + owned value optimization but can
occur once we start eliminating borrow scopes. I noticed that I needed this when
looking at the arbitrary RAUW for ownership API.