<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/79438>79438</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SPIR-V] OpEntryPoint operands validation issue in case of non-kernel functions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:SPIR-V
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
michalpaszkowski
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
michalpaszkowski
</td>
</tr>
</table>
<pre>
SPIR-V backend generates incorrect OpEntryPoint instructions for the following module:
```
define void @foo(i8 %a, ptr addrspace(1) %p) {
store i8 %a, i32 addrspace(1)* %p
ret void
}
```
The issue reported by spirv-val is:
```
error: line 7: OpExecutionMode Entry Point <id> '8[%foo]' is not the Entry Point operand of an OpEntryPoint.
```
The issue goes away when the function is a spir_kernel:
```
define spir_kernel void @foo(i8 %a, ptr addrspace(1) %p) {
store i8 %a, i32 addrspace(1)* %p
ret void
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0U81u2zwQfBrqsrAhrf4POjhxDHyHDwnaoteCElcSa5oUSMqu-_SFaAX5aXoqCgiiBHKWOzM73Dk5aKKG5XcM8SS7kauJu59Hc3FHyRBZvo_47Edjm_e7UWvEtfn89N-nzVdoeXckLWAgTZZ7ciB1Z6ylzsPj9KC9vT4ZqT1I7bydOy-NdtAbC34k6I1S5iL1ACcjZkUs3bF4z-LndxGvT_gV1EtNcDZSAMvi3hiGlayAYc4Z3sPkLXAhrJt4RwyrhGG9bE5hLe9uVcB5Ywle4WSKv-EY7m7QGwYs-XDx2li5_7DDLyOBdG4msDQZ60lAewU3SXvenLkC6V4YvkWStcaydAdqoVguX4_Tww_q5kWx_40gCGLCTU2W3kvB0gdgWFbBxHyRI98zLEE60MYHgV9jzESWawGmB67fmLP9sKX3lAZDDviFX-Eykr75N-vg6HIlDzy_HclqUn-iuVr46uRf2_lv_IxEk4o6rXlETVLGRVKlSYXR2FR1LEQiqKpi4kWBcZq0JUcsqrTjdZ9GssEYszjBPEmyAnEbi7aoetElPOuqhGqWxXTiUm2VOp-2xg5R0Lcp6yytIsVbUm4N5poulu5ucVuDaZsFumnnwbEsVtJ591LMS69CsFdIvn8bxHUMHJy5koKv9i0GSw0dd7QMiDZ6s_rz7LGLZqua0fspDDEeGB4G6ce53XbmxPCwdLAum8ma79R5hodQ2jE8BHq_AgAA__8qHV1N">