[PATCH] D100282: [Coroutines] Move CoroEarly pass to before AlwaysInliner

Xun Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 11 22:30:07 PDT 2021


lxfind added a comment.

In D100282#2682251 <https://reviews.llvm.org/D100282#2682251>, @rjmccall wrote:

> Why does this pass even exist?  We should just expect the frontend to set the attribute.  It's not like frontends don't have to otherwise know that they're emitting a coroutine; a ton of things about the expected entire IR pattern are different.

The attribute setting can totally be moved to the front-end. 
One thing that's not clear to me is whether we should simply set coroutine functions noinline instead of replying on the attributres for this.
GCC seems to complain about inlining coroutines: https://godbolt.org/z/KrzE1znno, not fully sure why.

As for the CoroEarly pass, it lowers a bunch of intrinsics. Technically I think they can all be done in the front-end. But moving some complexity out of front-end to IR seems reasonable to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100282



More information about the cfe-commits mailing list