<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/113520>113520</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`slp-vectorizer` miscompilation
</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/FmxNvP
```llvm
----------------------------------------
define <3 x i32> @add3_i96.2(<3 x i32> %#0, <3 x i32> %#1) {
#2:
%#3 = extractelement <3 x i32> %#0, i64 0
%#4 = sext i32 %#3 to i64
%#5 = extractelement <3 x i32> %#1, i64 0
%#6 = zext i32 %#5 to i64
%#7 = add nsw nuw i64 %#6, %#4
%#21 = trunc i64 %#7 to i32
%#22 = insertelement <3 x i32> %#1, i32 %#21, i32 0
ret <3 x i32> %#22
}
=>
define <3 x i32> @add3_i96.2(<3 x i32> %#0, <3 x i32> %#1) {
#2:
%#3 = shufflevector <3 x i32> %#1, <3 x i32> %#0, 0, 3
%#4 = extractelement <2 x i32> %#3, i32 0
%#5 = sext i32 %#4 to i64
%#6 = extractelement <2 x i32> %#3, i32 1
%#7 = sext i32 %#6 to i64
%#8 = add nsw nuw i64 %#5, %#7
%#22 = trunc i64 %#8 to i32
%#23 = insertelement <3 x i32> %#1, i32 %#22, i32 0
ret <3 x i32> %#23
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
<3 x i32> %#0 = < #x00000008 (8), #x00000000 (0), #x00000000 (0) >
<3 x i32> %#1 = < #xfffffff9 (4294967289, -7), #x00000000 (0), #x00000000 (0) >
Source:
i32 %#3 = #x00000008 (8)
i64 %#4 = #x0000000000000008 (8)
i32 %#5 = #xfffffff9 (4294967289, -7)
i64 %#6 = #x00000000fffffff9 (4294967289)
i64 %#7 = #x0000000100000001 (4294967297)
i32 %#21 = #x00000001 (1)
<3 x i32> %#22 = < #x00000001 (1), #x00000000 (0), #x00000000 (0) >
Target:
<2 x i32> %#3 = < #xfffffff9 (4294967289, -7), #x00000008 (8) >
i32 %#4 = #xfffffff9 (4294967289, -7)
i64 %#5 = #xfffffffffffffff9 (18446744073709551609, -7)
i32 %#6 = #x00000008 (8)
i64 %#7 = #x0000000000000008 (8)
i64 %#8 = poison
i32 %#22 = poison
<3 x i32> %#23 = < poison, #x00000000 (0), #x00000000 (0) >
Source value: < #x00000001 (1), #x00000000 (0), #x00000000 (0) >
Target value: < poison, #x00000000 (0), #x00000000 (0) >
Summary:
0 correct transformations
1 incorrect transformations
0 failed-to-prove transformations
0 Alive2 errors
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEV11vozgU_TXOi5XIvjYQHnjoTJrH3VV33lcOmMQV4Mg2adpfv8JQyldmsq1Wgypo8Tn3XF8fbm1hrTpWUiYo-IaC3UrU7qRNctDV8bmunlcHnb0mD4W6SMBGnrVxiD3gk3Nni9gDgj2CvfDDm6K4lBttjgj2qUSwf0Ow35fXPy5_IbJD5KG7h6T9aeDtq_WdV4vOZK4qiRH7zvAVKwaIPWLEicgy9o-Kww0g2E5GIUDACILvU5ofoAhijKJvXYLQjHXZ4g7CMGI7LK_OiNTJQpaycouxvIgKOSbjANwHsPLqGnwf1ekGPIYG92rRG1qhD_A21goWtSIPFVmGK_uCq_rFx-vC-Hq12Y9ZQD3NmbpKB4TISzCYgMGDVWWluWM6fcLQ_91Pz8hlJnSSKNp1v7AdYo-_3S_2VOd5IS8yddrcnvNNcX9jS0aauwOmEdisfEN7TZzIF90R_mctumSviVa4qLX9iRODDydGi-aaOnG77ET2SSfC_U5kEyf-MKKyuTalcEpXONPSVggihy_SqPwVAR02x8enpz-fmgb7Q5ijdFhZXGoj8VkrqytdW-xOosJW1yaVI-JVlOdC9j5ctJSfPWJNKdmVtNcWI9huEcRtifv3pHlPfvIe9x_YYgVHWnl7xQ2XQ8zjMIKtj7yOvibt73-35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