<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/204984>204984</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[X86] Failure to create BLSMSK instruction from integer reprensentable as i8
</td>
</tr>
<tr>
<th>Labels</th>
<td>
good first issue,
backend:X86
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
RKSimon
</td>
</tr>
</table>
<pre>
Similar to #202344 / #204746 - we should be able to use BLSMSK 32 for i8 types
```
----------------------------------------
define i8 @src(i8 %x) {
#0:
%neg = sub i8 %x, 1
%and = xor i8 %neg, %x
ret i8 %and
}
=>
define i8 @tgt(i8 %x) {
#0:
%xx = sext i8 %x to i32 ; anyext?
%neg = sub i32 %xx, 1
%and = xor i32 %neg, %xx
%res = trunc i32 %and to i8
ret i8 %res
}
Transformation seems to be correct!
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMk02PmzwQxz-NuYwSmbF5O3BINg-XfXppeujVwEDcgh3ZZst--8ok2a5WrbQI8eL5zct_PFbe69EQ1Sw7suyUqCVcrKu_Pp_1bE3S2v61PutZT8pBsMBQIEchJTBsbn-ykDns4BeBv9hl6qElUO1EEV88wfH_85fzMwiEwTrQJYTXK3nGDyzn95sfdp-8GD_0NGhDMRCT3LuOYRm_MVsZVsCKYwyNgjNxYPwA0WJoBCZO4JcW3tgnSB92ZfrNvt4KvHlEYiMj5CjcLcr0MUFxik9xYuK_jzWFMXyipnW9lUTrI_IaO6YFAhNHUOaV1sBE81cNEYoh_q3iRryTsT4wR37DgltM9wCjb8xeflDrbju1qf3mlPGDdbMK2hrwRLOPTi1BZ52jLjBM3-9r0teir0SlEqrTokSe5TLNkktdYZvmIhvaPpct5jlPez7wUsoiE9SlZaJr5JjzHNM0kzzN9ljIqq16mVdikGmBTHKalZ720_Qy760bE-39QjVyWZUymVRLk99mGnG0todBOx9ggxgiwyeG2KruJ5meicP3Mo-r2SlxdYy4a5fRM8kn7YP_kyPoMG0nJfLZCRqlp8Vtk945UuFt2LXxwS3d1qfB2Rm0CTSSA0dXR8aTCdsRUR50mSxuqi8hXH0cD2wYNqMOl6Xdd3Zm2MT099fu6uyPrdHNJsUzbO6SX2r8HQAA__8XQRJy">