[PATCH] D105877: [Coroutines] Run coroutine passes by default

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 13 19:48:09 PDT 2021


ChuanqiXu added a comment.

In D105877#2874194 <https://reviews.llvm.org/D105877#2874194>, @aeubanks wrote:

> can you add a clang test to make sure the commands in the description work?

Done.

> are the coroutine passes basically free when coroutines are not present? (i.e. they do a quick check and bail out immediately)

When coroutines are not present, the coroutine passes would check if the current function contains coroutine intrinsic. If no, coroutine passes would exit quickly. I think the check process is quick enough.



================
Comment at: llvm/lib/Passes/PassBuilder.cpp:1934
   MPM.addPass(AlwaysInlinerPass(
-      /*InsertLifetimeIntrinsics=*/PTO.Coroutines));
+      /*InsertLifetimeIntrinsics=*/false));
 
----------------
aeubanks wrote:
> is this not an issue anymore?
Yes, I handled this in InlineFunction.cpp


================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:2194
+  // caused by multithreaded coroutines
+  if ((InsertLifetime || Caller->isPresplitCoroutine()) &&
+      !IFI.StaticAllocas.empty()) {
----------------
lxfind wrote:
> What's the context of this change? Doesn't seem to be related to this diff?
Related contexts are at  line 1934 in PassBuilder.cpp. The pass builder would set InsertLifetimeIntrinsics to be true for AlwaysInliner even at O0 as the comments tells.

This change would make sure the AlwaysInliner to insert lifetimes at O0. It wouldn't affect inliner since inliner wouldn't run at O0. And normal inliner would insert lifetime all the time.


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

https://reviews.llvm.org/D105877



More information about the llvm-commits mailing list