<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64586>64586</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Coroutines] The Coroutine elision optimization (or HALO) is not performed
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            enhancement,
            llvm:optimizations,
            missed-optimization,
            coroutines
      </td>
    </tr>

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

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

<pre>
    There is a middle end optimization called `coroutine elision` to elide the dynamic allocation from coroutines. And there are several issue report complaining the compiler failed to optimize the project as expected.

This is not usually what we do for middle end optimization passes. Since for a optimization pass, it is common to forgive optimization oppotunities in complex cases. But coroutine elision (or HALO) is part of the coroutines semantics in many people's imagination even if it is not formally recorded. Then here is a slightly conflict.

To fully address the issue, I think we need involvement from the language side, either formally from WG21 or as a clang extension.

The issue is created to collect different issues/cases/requirements that people want coroutine elision (or HALO) so that we can handle similar things altogether. The issue reports I see now are including
- https://github.com/llvm/llvm-project/issues/64193
- https://github.com/llvm/llvm-project/issues/57852
- https://github.com/llvm/llvm-project/issues/56972

Feel free to provide more reports or requirements in this page.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVM1u4zYQfhrqMogh0ZZiHXTIJnC7QIEeGqC9UuRImpbiaEnKifv0BWknjhsUPexeEsicIb-_GRUCjQ6xE_UXUT8Vao0T--5xWpX7Rn-sbdGzOXXPE3oECqBgJmMsAjoDvESa6W8ViR1oZS0aEE2p2fMaySGgpUDsRFNC5PRlEOKEYE5OzaRBWcv63D54nuG9M2zgwZlU6xGURwh4RK8sUAgrgseFfQTN82IVOXJjvjZ9k0UPg6KEJfIbxPOzi-c_UUdQAfB1QR3RbET5JMqH89_niUIi6TjCGlZl7QleJhXhBcEwDOz_k_2iQkiofyOnMVeqzwVCPgLF9ILmeWaXAA7sR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