[PATCH] D94834: [Coroutine] Do not CoroElide if there are musttail calls

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 25 18:07:04 PST 2021


ChuanqiXu added a comment.

In D94834#2521729 <https://reviews.llvm.org/D94834#2521729>, @lxfind wrote:

>> And I think there are two cases about this example:
>> (1) The musttail call is dominated by  `@llvm.subfn.addr(%handle, 1)` calls. Then `%handle` is destroyed at the musttail call, so it makes no sense that the musttail call returns `%handle`.
>> (2) The musttail call isn't dominated by  `@llvm.subfn.addr(%handle, 1)` calls. Then the musttail call may returns `%handle`. And it doesn't matter since `%handle` won't be elided in this case.
>
> In case (1), why is it that '%handle' must be destroyed at the musttail call?

In my mind, `@llvm.subfn.addr(%handle, 1)` means a call which would destroy `%handle`. And CoroElide Pass also treat the call as a lifetime end marker for `%handle`. CoroElide pass only elides coroutine handle who is guarded by `@llvm.subfn.addr(%handle, 1)` .


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94834/new/

https://reviews.llvm.org/D94834



More information about the llvm-commits mailing list