<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/115465>115465</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[InstCombine] folded select produces different result on a shuffled vector
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bongjunj
</td>
</tr>
</table>
<pre>
Alive2 report: https://alive2.llvm.org/ce/z/73v-ug
```llvm
----------------------------------------
define <4 x i8> @sel_shuf_commute3.2(<4 x i8> %x, <4 x i8> %y, i1 %cmp) {
#0:
%blend = shufflevector <4 x i8> { 0, 0, 0, 0 }, <4 x i8> %y, 0, 5, 2, 3
%r = select i1 %cmp, <4 x i8> %y, <4 x i8> %blend
%#1 = select <4 x i1> { 0, 1, 0, 1 }, <4 x i8> { 0, 1, 2, 3 }, <4 x i8> %r
ret <4 x i8> %#1
}
=>
define <4 x i8> @sel_shuf_commute3.2(<4 x i8> %x, <4 x i8> %y, i1 %cmp) {
#0:
%#1 = shufflevector <4 x i8> %y, <4 x i8> { poison, 1, poison, 3 }, 0, 5, 2, 7
%#2 = select i1 %cmp, <4 x i8> %#1, <4 x i8> { 0, 1, 0, 3 }
ret <4 x i8> %#2
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
<4 x i8> %x = < poison, poison, poison, poison >
<4 x i8> %y = < poison, poison, poison, poison >
i1 %cmp = poison
Source:
<4 x i8> %blend = < #x00 (0), poison, #x00 (0), #x00 (0) >
<4 x i8> %r = < poison, poison, poison, poison >
<4 x i8> %#1 = < poison, #x01 (1), poison, #x03 (3) >
Target:
<4 x i8> %#1 = < poison, #x01 (1), poison, #x03 (3) >
<4 x i8> %#2 = < poison, poison, poison, poison >
Source value: < poison, #x01 (1), poison, #x03 (3) >
Target value: < poison, poison, poison, poison >
Summary:
0 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors
```
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