[llvm-bugs] [Bug 47133] New: Incorrect mul foo, undef -> shl foo, undef

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 12 04:35:38 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47133

            Bug ID: 47133
           Summary: Incorrect mul foo, undef -> shl foo, undef
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: nunoplopes at sapo.pt
                CC: lebedev.ri at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, regehr at cs.utah.edu

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
https://github.com/llvm/llvm-project/commit/0c1c756a31536666a7b6f5bdb744dbce923a0c9e


https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=b697cc49b7cc411c&test=Transforms%2FInstCombine%2Fmul.ll

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200812/268ddbaf/attachment.html>


More information about the llvm-bugs mailing list