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

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 15:08:56 PST 2021


lxfind created this revision.
Herald added subscribers: hoy, modimo, wenlei, hiraditya.
lxfind requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is to address https://bugs.llvm.org/show_bug.cgi?id=48626.
When there are musttail calls that use parameters aliasing the newly created coroutine frame, the existing implementation will fatal.
We simply cannot perform CoroElide in such cases. In theory a precise analysis can be done to check whether the parameters of the musttail call
actually alias the frame, but it's very hard to do it before the transformation happens. Also in most cases the existence of musttail call is
generated due to symmetric transfers, and in those cases alias analysis won't be able to tell that they don't alias anyway.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94834

Files:
  llvm/lib/Transforms/Coroutines/CoroElide.cpp
  llvm/test/Transforms/Coroutines/coro-elide-musttail.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94834.317088.patch
Type: text/x-patch
Size: 5725 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210115/3bbed6a1/attachment.bin>


More information about the llvm-commits mailing list