New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect mul foo, undef -> shl foo, undef #46477
Comments
assigned to @LebedevRI |
Thanks. |
The relevant transform is on the following, I think. define <2 x i32> @f(<2 x i32> %a0, <2 x i32> %a1) { instcombine has been doing this since 7.0. |
Yes, this is not a new miscompile per-se, this will need backporting. |
Added sanitization in 12d93a2. Whoever is interested, i've added some FIXME for followup improvements
|
Pushed to 11.x as 522eeb6 except the llvm/test/Transforms/InstCombine/mul.ll changes because those tests don't exist on the branch. |
mentioned in issue #47292 |
Extended Description
This is a recent regression in Transforms/InstCombine/mul.ll.
shl foo, undef is poison, so we can't introduce that.
define <2 x i32> @mulsub1_vec_nonuniform_undef(<2 x i32> %a0, <2 x i32> %a1) {
%sub = sub <2 x i32> %a1, %a0
%mul = mul <2 x i32> %sub, { 4294967292, undef }
ret <2 x i32> %mul
}
=>
define <2 x i32> @mulsub1_vec_nonuniform_undef(<2 x i32> %a0, <2 x i32> %a1) {
%sub.neg = sub <2 x i32> %a0, %a1
%mul = shl <2 x i32> %sub.neg, { 2, undef }
ret <2 x i32> %mul
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
<2 x i32> %a0 = < undef, undef >
<2 x i32> %a1 = < undef, undef >
Source:
<2 x i32> %sub = < undef, undef >
<2 x i32> %mul = < #x00000000 (0), #x00000000 (0) >
Target:
<2 x i32> %sub.neg = < #x00000000 (0), #x00000000 (0) >
<2 x i32> %mul = < #x00000000 (0), poison >
Source value: < #x00000000 (0), #x00000000 (0) >
Target value: < #x00000000 (0), poison >
Probably caused by 0c1c756
https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=b697cc49b7cc411c&test=Transforms%2FInstCombine%2Fmul.ll
The text was updated successfully, but these errors were encountered: