<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVdFu4zYQ_Br5hTjBlu0kfvCDz8EVAZIG6BVF3wqKWkmsZVJHUlH9950lZTvOHdACBziKJC6XM7Ozq9JWp-3vLYmKlPbaGiFLOwQR8Ep7P5BopRclkRFHWZGQKgyy60654E3aBDKBd9n63RbtRbCIP-A2CNWRdAgVSnqKUYMnx0HKmhr3VS6eghjt0FU4SZD0Guu1dRx85FQeGVSbZ_PHbL5LVz5eWUeid7bsEIZ8CXqve-q0IWFdRU6bBumNeJ1fFrJiH2HsulGe_JOJwb30XrjBAEHNaffW2a99B_y8koudqeImnIlDeEcr38hkxX1I8vgYrJjF-S1Ic-5KVBAFNOL-wTloBr29bqJul4y5-GpFSy4J2F6o3fD-1QYWUQZW9NWIrHjgyyJbPop5Vmz-B8ukNHOVdYDSt1SF_28QT6IZyMd1BF4qF0YrvmGBHZEtp1gAXDCufYwaKfniKiN0wVaJM6bbs2hTIdLLqG62_PLBAggIWslO9NZ7jRy5-AwLgArQt9JVrFLv4FqtsLbrvJ1AS_xZvk2e9dGgF1DGjrEaTxM5L0-cdLyp7vlM3mrY4_UQBkc3SoF9ccOeZf8g-ET0u0J9oPsiTzj0RD71nkOfoPHG9sRpKz3hqpggyMfqwSXPz3-8xAMTMbz20IXlPYl9VnzG77rMnvGjrsM7KSSM__L89FtsyKgLn95pH8RRN21UorOmodjj7JgkAzvzGCGPNkKDDKmNANcQEKCyB6Kex4BHOu6KUYcWlIA71aaTphlkQ0yLy3aj7c6koEkJpKtSj11m2VkEFiiBYHHM4SKRBIJTckAufiFDjocbx9M_PanASRtCnciB_lEaBQmPaIk3OjJeXSdHuwP4SDA3Ko7DyEPGgv6V_DwZM8YrNt80rK6JWXws-vZqMgxHDK7JtzfpGDzo40wfUCF2ek2SdY81tOzW95m4xUQ5NIxAs0vIp4XRuoMYDCYln3TT5LU42SGOuXiMQ5HfaT3huBrle84C0r_OGRAnUqmTgsQAw_OlbmwwR7Ync_2E3PZQvM6q7bLaLDdyJofQWrfdt4M03_Sfw2Y2uG7bhtB7njrFF_wagBnKXNkjHrru7fzvE2r3NwqLx9T3uFkvV4vlrN1S_fCwvKPVXalw83C3WUlVyLpaqwdSG7qfdbKkzm-zNbqmUKl5CvArsvXj7OcR6G0xL4r5oribL1er9Tqn-9WCVqtyvShXZV1tstWcjlJ3OefJrWtmbhtTorAei9yU_rqIEYJPDFEEDIRBh47ix_7c-NfiTRb-QQ1__EWLlRWzyGAb4f8LoXfTUA>53413</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            The C++ coroutine marked with always_inline couldn't be inlined at O0 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            c++20
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ChuanqiXu9
      </td>
    </tr>
</table>

<pre>
    The decision about the issue has been made actually. The intention of the issue is to make it clear in case the user is confused. It would be easier for them to search.

The core problem is about pipeline ordering. In O0 pipeline, the AlwaysInline pass run before CoroSplit pass. And the coroutine haven't been split couldn't be inlined due to the current design of coroutine. So here is the problem.

Note that in On (n != 0) pipeline, the AlwaysInline pass would run after CoroSplit pass so here is the problem.

I guess there would be two question:
(1) Could we make coroutine to be able to be inlined before to be split?

Theoretical possible. But it is hard in practice. Also there are other issues in coroutine now. So I would say it wouldn't be possible in near future.

(2) Could we run CoroSplit pass before AlwaysInline pass?

Maybe yes. The reason why we didn't do this is that LLVM Coroutine is shared by C++ Coroutine, swift coroutine and MLIR for now. The list might be longer in the future (maybe won't). And we need to keep consistent with what other language do here.

Another reason to do the decision is that we don't think this is a key issue. Generally we expect to get performance improvement if we marked a function with always_inline. But if we care about performance, we shouldn't use O0. Also always_inline is not a standard feature, so it shouldn't be a bug if it doesn't work under O0.

If you have a strong reason to inline coroutine with always_inline at O0, you could state your reason and reopen the issue.



</pre>
<img width="1px" height="1px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