<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/72860>72860</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SPIR-V] `or i1` related validation error
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
linehill
</td>
</tr>
</table>
<pre>
The following LLVM IR:
```llvm
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spirv64"
define spir_kernel void @foo(
ptr addrspace(1) nocapture noundef writeonly %Dst,
i32 %a, i32 %b) local_unnamed_addr #0 {
entry:
%a1 = trunc i32 %a to i1
%b1 = trunc i32 %b to i1
%ab1 = or i1 %a1, %b1
%ab32 = zext i1 %ab1 to i32
store i32 %ab32, ptr addrspace(1) %Dst
ret void
}
```
Does not validate:
```
$ llc -O0 <above-llvm-ir>.ll -filetype=obj -o - | spirv-val -
error: line 34: Expected int scalar or vector type as Result Type: BitwiseOr
%ab1 = OpBitwiseOr %bool %a1 %b1
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVE1v5CgQ_TX4UnIEhe22Dz504mlppFlllR3NNcJ2dTezxFiAnen99StodzIfkSwDVY9H8aoo5b0-TUQtK-9Z2WVqCWfrWqMnOmtjst6Ol_brmeBojbGvejrBly_f_oLPT0zuGe8Y37OKXz9j1perKSh3ogCjCsqoi10CMNkBQ6RcVwWT-6rIV1ExuRdVvmK0SMxXidukqDdMkzBY56toohPLiC-r27QU0VoKzFfBE08aEH-JIzg9G7rF4Gft1uoddP2PdNQTQXQ-_0tuIgOr1SOwgh-tZVhfYQBzcKDG0flZDcSwFgwbmOyg5rA4gsku00hHeHU6kJ3MBRiWnQ8MH24MWmI0KoYPt3kfSYwdlHlepkm90PgczwCGkgPb3V-30hTc5U13SCQiXSu4ZRreiCFY0OInVP8Bqv8DpTaYdaDFlTyGmPb_AosEsoP_6Ee4IXuR6CTegD5YR28R9RIj1Yfabfps-xyFJPyWm133W5Fdl50lD5MNsCqjRxXoz2rclliAMQPkjxyYfFC9XSmPhZprx-SnO2MgP2pD4TITk53tv0NuIQe2e0i1sOarMpBv-jtnHZN7iM8DZCw3-PRjpiHQCHoK4AdllIsCrjQE6yDSgvLwRH4xAb6mU_Zwr8Or9vToPlD_cX7zJumtNbdEvyfit7tmYyvHRjYqo1bsOC9qibLOzi01Pfa8KupjKUY59NXYlGPBGxp2vKgUz3SLHKUQyAXiTuzujruxqYtB9n2h-iMKVnB6UdrcRdHurDtl2vuF2h3WFc-M6sn41DwQJ3qF5IxPq-wy1yah--XkWcGN9sG_swQdTOo6__z9-Sn_xsoOWMVT6bGKgyOjoqpbfrWdIKmfLc605xBmHzOOB4aHkw7npb8b7AvDQ-pB1yGfnf1OQ2B4SFF5hocU9f8BAAD__1Jjalg">