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

    <tr>
        <th>Summary</th>
        <td>
            [GPUToLLVM] `gpu.launch_func` lowering in gpu-to-llvm only supports 1 async dependency
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Currently, `gpu-to-llvm` lowering only supports one async dependency on `gpu.launc_func`. More than 1 dependency results in failure. (https://github.com/llvm/llvm-project/blob/main/mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp#L954).

However, if a `gpu.launch_func` already has a dependency, and we run `gpu-async-region` pass on it. It may end up with more than one async dependency.

So, we either have to,

1. Update the `gpu-to-llvm` to handle more than 1 async dependency on `gpu.launch_func`, or
2. Update the `gpu-async-region` pass to make sure, no `gpu.launch_func` op ends up with more than 1 async dependency.

1 is more suitable, since, the `gpu.launch_func` itself does not employ the restriction, solving 1 would provide a more robust solution.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUlM2O4zYMx59GvhAxZNmO44MPaRZpC8wCBdrttZAtJlYri4Y-EvjtCzmZTLqbRbEnCRKpP_mjSOm9PlvEjtU_sfpTJmMYyXWTH-VokbKe1NIdonNog1mYOADb8vMcN4E2xlwmtuVg6IpO2zOQNQv4OM_kggeyCNIvdgCFM1qFdliA7P2B3Mhoh79O0Q5sy3P4TA4hjNJC8Wzv0EcTPGgLJ6lNdJgDE7sxhNmzcs_EkYnjWYcx9vlAExPHNarbspkd_Y1DYOLYG-qZOE5S27QY7ZKNTmcHshd0XlO6-fm3Lweapvf9H_T29ufnD4t8mGcmyre2rphoc8b3jO9_oSte0CU4-gTyPwmO7xmCNA6lWmCUHuRTislNWgVXBBff6WxWcBuH5xTWlsMsfSIKOuTwa4BJLoBWQZzhqsMI04PeK-r3OH-npHVFQB1GdDDKC0JIh7f7Iocvs5IhvYQv6hwIRmmVwSe54n9L_CCQxMkxvhevdF4mHAgm-Q-Cjw6Tu6XvwKU54fAveHwb4J1GAdrf7HzUQfZmVfDaDuvmI7SvtXTwaE6gCD1YCoDTbGhZHRz64PQQ1r90AE_mkvqigCtFo2B2dNEKQd50HfXRh2QVk0eeqa5UbdnKDLuiqRsu2ko02dg1w3Y4qXpQJW-aqhlEWxSDarmUXJzKU53pTnBR85ZXoqzKqslVK1uJWDa83bXbfscqjpPUJk-1zMmdM-19xK6ot-2uyozs0fh1Bghh8QrrLRMijQTXrb3Ux7NnFTfaB__xTNDBrMPj0Sys_vQdcI85oS08fa2vxsa3BcuiM90Pd_yagmfieM_x0ol_AwAA__9IK6VJ">