-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix ownership issues with sequences of partial_apply's in AutoDiff closure specialization pass #80662
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
AutoDiff closure specialization pass: each partial_apply consumes its arguments, therefore we should never release intermediate ones in the sequence of closures. Fixes #78847
I also added end-to-end swift test to test the pass, apparently there are no tests for this. |
@swift-ci please test |
The explanation of wrong behavior is in #78847 (comment) |
Reenabling it back also gives huge performance boost. We are having (on benchmark from #80665) Before:
After:
|
@swift-ci please test |
Tagging @JaapWijnen |
Nice! Also the performance boost. Is this boost related to the loss in performance we saw in January @asl ? Or separate and thus an improvement on top of the performance we had in early January? |
@JaapWijnen Correct. This brings the performance back to January figures @eeckstein Here is what happened:
|
Looks good from what I can tell. Thanks for fixing! |
acb54c2
to
a2c214c
Compare
@swift-ci please test |
@swift-ci please smoke test |
Fix ownership issues with sequences of partial_apply's in AutoDiff closure specialization pass (swiftlang#80662) Each partial_apply consumes its arguments, therefore we should never release intermediate ones in the sequence of closures. Fixes swiftlang#78847 (cherry picked from commit 87ca0f8)
Each partial_apply consumes its arguments, therefore we should never release intermediate ones in the sequence of closures.
Fixes #78847