Skip to content

Incorrect mul foo, undef -> shl foo, undef #46477

@nunoplopes

Description

@nunoplopes
Bugzilla Link 47133
Resolution FIXED
Resolved on Oct 23, 2020 18:33
Version trunk
OS All
Blocks #47292 #46070
CC @efriedma-quic,@zmodem,@LebedevRI,@RKSimon,@regehr
Fixed by commit(s) 12d93a2

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions