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

Yifeng Dong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 6 18:39:32 PST 2020


dongAxis1944 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"); }
+
----------------
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.


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