<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/130216>130216</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang should go through ABI lowering when emitting call to __enqueue_kernel_basic
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:codegen,
OpenCL
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
arsenm
</td>
</tr>
</table>
<pre>
In https://github.com/llvm/llvm-project/pull/130011 I hacked around the emission for BIenqueue_kernel getting the wrong argument type for a byref (or byval) passed argument.
This code should avoid special casing the IR used for calling the builtin function, and go through the ordinary ABI lowering to find the IR types.
Attaching junk patch I produced while trying to figure out how to do this.
[0001-clang-Try-to-use-ABI-paths-for-emitting-call-to-__en.patch](https://github.com/user-attachments/files/19117472/0001-clang-Try-to-use-ABI-paths-for-emitting-call-to-__en.patch)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykU02L4zgU_DXy5eEgyXESH3xIugkYFhaavgfZerbUrUhefSTk3y9Sb3Z6LgPDnIRFud6rUpUIQS8WsSftibSvlUhROd8LH9Beq9HJRz9YUDGugTRHws-EnxcdVRo3k7sSfjbm9jzq1bsPnCLh5zUZQ_iZNZQyBgMoMX2iBOFdshKiQsCrDkE7C7PzcBrQ_pMw4eUTvUUDC8ao7VKQd-_sAsIv6Yo2QnysWH4SMD48zkD4wXkYHzdhCO9gFSGUUV_4DRB6JPT4rnSAyUmEoFwyEsTNaQlhxUkLA5MIz3nDG6TMkGdMwpjn_Zi0idrCnOwUtbOEv4CwEhYHUXmXFlVgzktthX_A8TSAcXf0hcDBrP-TPrwVEeG52jFGMamM-kj2E1YRJwUDrN7JNKGEu9IGIfrH_0RL8gguRVDunm9kXkGHzRcfaU-UUlZPRtilfvePOro6BayPp6FeRVShnp2v8aqLyXUWmSGXC9pNmU7aV8IPv3j1FNDXouydTQ6En2dtMJ-sY2y_3XPCz3-6Be8q2TeyazpRYc_2W9YwynZtpXrKqJTj9iAOlI5dyw7Ip07S3dxShiM7VLrnlLe0oXvK2I62mxkF7fZbMWHTziPryJbiVWizydHdOL9UOoSEPWsoZ7vKiBFNKLXgvGggzTHnZ0FLOCf8hXD-94r25a_82b5Wvi8lGNMSyJYaHWL4wR11NNgXnmcAv-Xmp6jcFVp42lISmJ842_K9IpdRBD1VyZv-t9tZhIavfmatt57_GwAA___nx1oX">