Skip to content

Reland Allow normal function results of @yield_once coroutines #71645

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

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

asl
Copy link
Contributor

@asl asl commented Feb 15, 2024

The main difference as compared to #69843 is workaround to LLVM coroutines lowering. LLVM assumes that unwind patch of retcon coroutines never returns. This is not quite true in case of Swift coroutines as we might abort a coroutines in case when something is thrown during coroutine execution. In such case the unwind path should terminate normally, but with error result set.

This certainly should be fixed at LLVM side properly. For now workaround this issue by ending LLVM corouting normally always, returning undefs on unwind path.

@asl
Copy link
Contributor Author

asl commented Feb 15, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Feb 15, 2024

preset=buildbot,tools=RA,stdlib=DA
Please test with swiftlang/llvm-project#8199
@swift-ci please test with preset

@asl
Copy link
Contributor Author

asl commented Feb 15, 2024

Tagging @rxwei @BradLarson

@asl asl force-pushed the end-apply-result branch from e9f5cfc to debe0dd Compare February 15, 2024 16:46
@asl
Copy link
Contributor Author

asl commented Feb 15, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Feb 15, 2024

preset=buildbot,tools=RA,stdlib=DA
Please test with swiftlang/llvm-project#8199
@swift-ci please test with preset

@asl
Copy link
Contributor Author

asl commented Feb 16, 2024

preset=buildbot,tools=RA,stdlib=DA
Please test with swiftlang/llvm-project#8199
@swift-ci please test with preset linux platform

@asl asl force-pushed the end-apply-result branch from debe0dd to cd920a7 Compare February 16, 2024 06:16
@asl
Copy link
Contributor Author

asl commented Feb 16, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Feb 21, 2024

@rjmccall ping

@asl
Copy link
Contributor Author

asl commented Feb 28, 2024

@rjmccall @hborla @xedin @slavapestov @kavon @tkremenek Another weekly ping. How can we proceed with reviews? It is pending since November and it's almost March now.

Please let me know if you are not interested in these PRs, so we can just abandon these contributions

Thanks!

@rjmccall
Copy link
Contributor

The review has been slow, but describing it as "pending since November" is not accurate. Your patch was approved, committed, and then got reverted because it was breaking a lot of code.

I'll take a look at the revised approach.

@asl
Copy link
Contributor Author

asl commented Feb 29, 2024

and then got reverted because it was breaking a lot of code.

I think it's not accurate as well. Indeed there was a breakage that was exposed in one particular configuration outlining subtle issues how swift coroutines are implemented at LLVM side. To fix this the workaround was introduced at Swift side as it is still under discussion what would be a proper LLVM fix.

Anyway I appreciate your time and thanks for reviews!

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, this looks okay for the short term.

@asl
Copy link
Contributor Author

asl commented Feb 29, 2024

@rjmccall Thanks, John, much appreaciated.

I will rebase, re-test as much as possible and we will see how it will go.

@asl asl force-pushed the end-apply-result branch from cd920a7 to ad6751c Compare February 29, 2024 03:38
@asl
Copy link
Contributor Author

asl commented Feb 29, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Feb 29, 2024

preset=buildbot,tools=RA,stdlib=DA
Please test with swiftlang/llvm-project#8199
@swift-ci please test with preset

@asl
Copy link
Contributor Author

asl commented Feb 29, 2024

So, the Linux fails with debug stdlib look unrelated. Everything else is passing, including debug stdlib configuration on MacOS that failed before.

@asl asl force-pushed the end-apply-result branch from ad6751c to 877b277 Compare March 22, 2024 10:59
@asl
Copy link
Contributor Author

asl commented Mar 22, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Mar 22, 2024

preset=buildbot,tools=RA,stdlib=DA
Please test with swiftlang/llvm-project#8199
@swift-ci please test with preset

@asl asl force-pushed the end-apply-result branch from 877b277 to 5662b36 Compare March 22, 2024 15:09
@asl
Copy link
Contributor Author

asl commented Mar 22, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Mar 22, 2024

preset=buildbot,tools=RA,stdlib=DA
Please test with swiftlang/llvm-project#8199
@swift-ci please test with preset

@asl asl force-pushed the end-apply-result branch from 5662b36 to ce01a62 Compare March 23, 2024 19:09
@asl
Copy link
Contributor Author

asl commented Mar 23, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Mar 24, 2024

Please test with swiftlang/llvm-project#8199
@swift-ci please test windows platform

@asl asl merged commit d84847a into main Mar 27, 2024
@asl asl deleted the end-apply-result branch March 27, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants