<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Invalid undef splat in instcombine"
   href="https://bugs.llvm.org/show_bug.cgi?id=45455">45455</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Invalid undef splat in instcombine
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Keywords</th>
          <td>miscompilation
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>nunoplopes@sapo.pt
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, regehr@cs.utah.edu, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Test: Transforms/InstCombine/unfold-masked-merge-with-const-mask-vector.ll

define <3 x i4> @splat_undef(<3 x i4> %x, <3 x i4> %y) {
  %n0 = xor <3 x i4> %x, %y
  %n1 = and <3 x i4> %n0, { 14, undef, 14 }
  %r = xor <3 x i4> %n1, %y
  ret <3 x i4> %r
}
=>
define <3 x i4> @splat_undef(<3 x i4> %x, <3 x i4> %y) {
  %1 = and <3 x i4> %x, { 14, undef, 14 }
  %2 = and <3 x i4> %y, { 1, undef, 1 }
  %r = or <3 x i4> %1, %2
  ret <3 x i4> %r
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
<3 x i4> %x = < #x0 (0), #xd (13, -3), #x0 (0) >
<3 x i4> %y = < undef, #x8 (8, -8), #x0 (0) >

Source:
<3 x i4> %n0 = < #x0 (0), #x5 (5), #x0 (0) >
<3 x i4> %n1 = < #x0 (0), #x0 (0)       [based on undef value], #x0 (0) >
<3 x i4> %r = < #x0 (0), #x8 (8, -8), #x0 (0) >

Target:
<3 x i4> %1 = < #x0 (0), #x1 (1), #x0 (0) >
<3 x i4> %2 = < #x0 (0), #x0 (0), #x0 (0) >
<3 x i4> %r = < #x0 (0), #x1 (1), #x0 (0) >
Source value: < #x0 (0), #x8 (8, -8), #x0 (0) >
Target value: < #x0 (0), #x1 (1), #x0 (0) >


<a href="https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=2009353267698970&test=Transforms%2FInstCombine%2Funfold-masked-merge-with-const-mask-vector.ll">https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=2009353267698970&test=Transforms%2FInstCombine%2Funfold-masked-merge-with-const-mask-vector.ll</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>