<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 - After r311849 Loop Vectorizer generates broken code"
   href="https://bugs.llvm.org/show_bug.cgi?id=34711">34711</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After r311849 Loop Vectorizer generates broken code
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>opt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>Alberto.Magni@microsoft.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>ayal.zaks@intel.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19194" name="attach_19194" title="Reproducer">attachment 19194</a> <a href="attachment.cgi?id=19194&action=edit" title="Reproducer">[details]</a></span>
Reproducer

The loop vectorizer breaks the two attached programs:

Instruction does not dominate all uses!
  %6 = shufflevector <2 x i16> %vector.recur, <2 x i16> %5, <2 x i32> <i32 1,
i32 2>
  %1 = sext <2 x i16> %6 to <2 x i32>

The file before_lv.ll is the one that originally triggered the problem for me.
reduced.ll has been obtained with bugpoint starting from before_lv.ll

To reproduce:
opt -force-vector-width=2 -loop-vectorize reduced.ll -S -o x.ll
opt -force-vector-width=2 -loop-vectorize before_lv.ll -S -o x.ll</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>