-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SUA][IRGen] Change IRGen to emit calls to swift_coroFrameAlloc #79384
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
When TMO is enabled, change IRGen to pass the newly introduced runtime function `swift_coroFrameAlloc` (and pass an additional argument — the hash value) instead of `malloc` when it inserts calls to `coro_id_retcon_once`. The hashValue is computed based on the current function name (computed in `getDiscriminatorForString`) rdar://141235957
You need to cherry-pick swiftlang/llvm-project#10015 to the llvm-project branch that For example, something like the following should work:
Please put this behind an IRGen flag For staging/back-deployment purposes, we will need to call through a stub that checks for the presence of The stub functionality can be added in a later commit. |
Please test with following pull request: @swift-ci test |
…e frame allocation
Please test with following pull request: @swift-ci test |
Please test with following pull request: @swift-ci test |
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.
This looks good to me.
Things to fix in followups:
1.) For staging/back-deployment purposes, we will need to call through a stub that checks for the presence of swift_coroFrameAlloc in the runtime library (use a weak symbol ref that it checks for null).
2.) Compute a 32bit hash (the function used computes a 16bit truncated value, we should add a new one for this purpose)
3.) Pass a properly constructed malloc_type_id value to the runtime function
Please test with following pull request: @swift-ci test |
Please test with following pull request: @swift-ci test |
When TMO is enabled, change IRGen to pass the newly introduced runtime function
swift_coroFrameAlloc
(and pass an additional argument — the hash value) instead ofmalloc
when it inserts calls tocoro_id_retcon_once
. The hashValue is computed based on the current function name (computed ingetDiscriminatorForString
)rdar://141235957