[PATCH] D108122: FunctionAttrs: do not mark coroutines with odd return path `noreturn`

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 20 03:08:30 PDT 2021


t.p.northover added a comment.

I've looked into this some more, and the return inserted by `@llvm.coro.end` is not necessarily representable in this function. If it's a `@llvm.coro.id.retcon.once` coroutine then the return is always a `ret void`, regardless of this function's prototype.

So, what if we require a `ret undef` instead as about the closest we can get? The real return (in the non-once case) is usually roughly `{i8* null, <lots of undef>}` and importantly doesn't contain any values from the function so we won't be lying about dataflow by using `undef`.

That's a doc change, a bunch of tests, and probably an autoupgrade (as well as Swift adoption). I'll tentatively get started.


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

https://reviews.llvm.org/D108122



More information about the llvm-commits mailing list