[PATCH] D92706: [coroutine] should disable inline before calling coro split

Xun Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 7 08:18:54 PST 2020


lxfind added inline comments.


================
Comment at: llvm/include/llvm/IR/Function.h:272
+  /// Check if this function is a coroutine.
+  bool isCoroutine() const { return hasFnAttribute("coroutine.presplit"); }
+
----------------
dongAxis1944 wrote:
> wenlei wrote:
> > What is the definition of a coroutine function here? The main coroutine function alone, or does that include split funclets? A function is consider a coroutine function only before corosplit, but no longer after split? 
> > 
> > I'm not sure if presplit attribute is the best way to tell whether function is coroutine because the attribute is added, removed in the process of codegen only to reflect split state. And it doesn't look like an invariant. Also what we need here in the context of inline check is not whether a function is coroutine, but wether a function is a presplit coroutine, right?
> > 
> I do not think it is the best way to use the string coroutine.presplit instead of the macro CORO_PRESPLIT_ATTR.
> 
> The other parts  in LLVM uses CORO_PRESPLIT_ATTR, but not directly use the constant string. so I think it might keep it same.
@dongAxis1944 Where would you suggest to put the definition of CORO_PRESPLIT_ATTR? From what I can see, it seems common in LLVM to use string attribute directly (not saying it's good, but there doesn't seem to be an infrastructure to make this better).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92706



More information about the llvm-commits mailing list