Skip to content

🍒 [Coro][WebAssembly] Add tail-call check for async lowering #8173

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

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Feb 12, 2024

Cherry-pick llvm#81481


This patch fixes a verifier error when async lowering is used for WebAssembly target without tail-call feature. This missing check was revealed by b1ac052, which removed inlining of the musttail'ed call and it started leaving the invalid call at the verification stage. Additionally, TTI::supportsTailCallFor did not respect the concrete TTI's supportsTailCalls implementation, so it always returned true even though supportsTailCalls returned false, so this patch also fixes the wrong CRTP base class implementation.

This patch fixes a verifier error when async lowering is used for
WebAssembly target without tail-call feature. This missing check was
revealed by b1ac052, which removed
inlining of the musttail'ed call and it started leaving the invalid call
at the verification stage. Additionally, `TTI::supportsTailCallFor` did
not respect the concrete TTI's `supportsTailCalls` implementation, so it
always returned true even though `supportsTailCalls` returned false, so
this patch also fixes the wrong CRTP base class implementation.
@kateinoigakukun kateinoigakukun force-pushed the yt/cherry-pick-wasm-coro-fix branch from 96c228e to 625a0c9 Compare February 20, 2024 05:33
@kateinoigakukun
Copy link
Member Author

@swift-ci test

@kateinoigakukun kateinoigakukun marked this pull request as ready for review February 20, 2024 05:34
@kateinoigakukun
Copy link
Member Author

@swift-ci test macOS platform

@kateinoigakukun
Copy link
Member Author

@swift-ci Please test macOS platform

@kateinoigakukun
Copy link
Member Author

This will repair the compiler crash in WebAssembly CI https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-20.04-webassembly/1963/console

@kateinoigakukun kateinoigakukun merged commit 3ffb6c4 into swiftlang:stable/20230725 Feb 21, 2024
@kateinoigakukun kateinoigakukun deleted the yt/cherry-pick-wasm-coro-fix branch February 21, 2024 01:59
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