<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107219>107219</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[NVPTX] Clang errors with non-trivial scalar-to-vector conversion when using opencl vector of two 8-bit integer as input
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rashedmyt
</td>
</tr>
</table>
<pre>
This issue started occurring with LLVM 18. Below is the reproduction code and the command used to reproduce the issue.
```cuda
typedef char cchar __attribute__((ext_vector_type(2)));
__global__ void kernel(cchar* out, cchar in) {
int tid = blockDim.x * blockIdx.x + threadIdx.x;
out[tid] = in;
}
```
```bash
$ clang --cuda-path=<cuda_root> --cuda-gpu-arch=sm_60 --cuda-device-only -O3 -S repro.cu -o repro.ptx
error: non-trivial scalar-to-vector conversion
1 error generated when compiling for sm_60.
```
Here is a link of compiler explorer where issue is reproduced - https://cuda.godbolt.org/z/c8jscoach
More Observations:
1. The issue only occurs when using a scalar input of the 8-bit integer vector of size 2. For other sizes and when a pointer is used, PTX is generated.
2. The issue doesn't occur when using other lower bit integers such as short for 16-bit integers
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVFFv2zgM_jXKC2HDlp3GefBD21xwB2y3AVcMezNkibG1KpIh0Wm6X3-Q7HZZcQ8HGE5Ii-T3kR8lQtCDRWzZ9oFtDxsx0-h860UYUZ1fadM79do-jTqADmFGCCQ8oQIn5ey9tgO8aBrh06dvn6FscnhA415AB6ARwePknZolaWdBOoUgrEpfpDuf4_85oAJy7ycxfU2lclYcWHG_vu-K5ZGzEouLXidUeAI5Cg8yvbtOEHndz4Rdx3jDeINX6i4oyfkuBjDecMb361M93NbousG4Xpiug4vTCp7RWzSMNyk54_fgZmL8cS2mLeN7YLs1BwCAtgSkFbDqAL1x8vmgz_kVYmgy_1LXZD4AjR6FSvY7ipR--0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