Skip to content

Reland "Cherry-pick 51d5d7bbae92493a5bfa7cc6b519de8a5bb32fdb from LLVM mainline" #8199

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 2 commits into from
Mar 27, 2024

Conversation

asl
Copy link

@asl asl commented Feb 15, 2024

Required for swiftlang/swift#71645

@asl
Copy link
Author

asl commented Feb 15, 2024

Please test with swiftlang/swift#71645
@swift-ci please test

@asl
Copy link
Author

asl commented Feb 15, 2024

Please test with swiftlang/swift#71645
@swift-ci please test

@asl
Copy link
Author

asl commented Feb 21, 2024

@rjmccall This is LLVM part of swiftlang/swift#71645

@asl asl force-pushed the coro-retcon-once-return branch from 85718fe to 029f874 Compare February 29, 2024 03:38
@asl
Copy link
Author

asl commented Feb 29, 2024

Please test with swiftlang/swift#71645
@swift-ci please test

@asl
Copy link
Author

asl commented Feb 29, 2024

Please test with swiftlang/swift#71645
@swift-ci please test windows platform

@asl
Copy link
Author

asl commented Feb 29, 2024

@rjmccall Will you please check / review this PR as well? This is a cherry-pick from LLVM mainline that is required for swiftlang/swift#71645

Thanks!

Tagging @rxwei

@asl
Copy link
Author

asl commented Mar 7, 2024

@rjmccall Ping

Thanks!

@rjmccall
Copy link

rjmccall commented Mar 7, 2024

Hi, Anton. Sorry for the delay; I'm trying to figure out what our risk tolerance on merging patches like this is, since this is a long-established release branch.

@asl
Copy link
Author

asl commented Mar 7, 2024

Sure. Few points here:

  • This is cherry-pick from LLVM mainline
  • The patch in question is in LLVM since August 2023
  • There is an auto-upgrade path for bitcode in "old" format
  • The corresponding patch is already in next branch just in case

@rjmccall
Copy link

rjmccall commented Mar 8, 2024

Alright. We're going to hold on this for a week or so until an internal branch is complete, but then we plan to merge it, and it should ultimately land in Swift 6.0.

@asl
Copy link
Author

asl commented Mar 8, 2024

Alright. We're going to hold on this for a week or so until an internal branch is complete, but then we plan to merge it, and it should ultimately land in Swift 6.0.

Great, thanks!

@asl
Copy link
Author

asl commented Mar 14, 2024

Hi @rjmccall

Just wondering about the status of your internal branch.

Thanks!

@rjmccall
Copy link

Okay, 6.0 has branched, so if you want to land this in this branch, you're welcome to. Swift main will probably stay on this branch for a few months until eventually retrenching from LLVM main.

asl added 2 commits March 22, 2024 11:02
…al result (llvm#66333)

One of the main user of these kind of coroutines is swift. There yield-once (`retcon.once`) coroutines are used to temporary "expose" pointers to internal fields of various objects creating borrow scopes.

However, in some cases it might be useful also to allow these coroutines to produce a normal result, but there is no convenient way to represent this (as compared to switched-resume kind of coroutines where C++ `co_return` is transformed to a member / callback call on promise object).

The extension is simple: we allow continuation function to have a non-void result and accept optional extra arguments via a special `llvm.coro.end.result` intrinsic that would essentially forward them as normal results.
@asl asl force-pushed the coro-retcon-once-return branch from 029f874 to c332d85 Compare March 22, 2024 10:59
@asl
Copy link
Author

asl commented Mar 22, 2024

Please test with swiftlang/swift#71645
@swift-ci please test

@asl
Copy link
Author

asl commented Mar 23, 2024

Please test with swiftlang/swift#71645
@swift-ci please test windows platform

@asl
Copy link
Author

asl commented Mar 24, 2024

@rjmccall Thanks! I rebased both this PR and swiftlang/swift#71645

Will you be able to land both for me? They need to be merged at the same time, but I do not have commit access to apple/llvm, so I cannot do this by myself.

Thanks!

@rxwei rxwei merged commit 13f109c into swiftlang:stable/20230725 Mar 27, 2024
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.

3 participants