<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 Loop Distribution: "Instruction does not dominate all uses!""
   href="https://llvm.org/bugs/show_bug.cgi?id=30880">30880</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>After Loop Distribution: "Instruction does not dominate all uses!"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

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

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mikael.holmen@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17537" name="attach_17537" title="Reduced reproducer">attachment 17537</a> <a href="attachment.cgi?id=17537&action=edit" title="Reduced reproducer">[details]</a></span>
Reduced reproducer

With

 opt -S -loop-distribute red.ll

I get

Instruction does not dominate all uses!
  %_tmp46 = getelementptr [1 x i16], [1 x i16]* %_tmp40, i16 0, i64 2
  %bc1 = bitcast i16* %_tmp46 to i8*
Instruction does not dominate all uses!
  %_tmp46 = getelementptr [1 x i16], [1 x i16]* %_tmp40, i16 0, i64 2
  %bc3 = bitcast i16* %_tmp46 to i8*
LLVM ERROR: Broken function found, compilation aborted!

Looking at the two first bb:s after Loop Distribution I see

*** IR Dump After Loop Distribition ***
define void @bar() {
  %_tmp10 = call i16* @foo()
  %_tmp31 = bitcast i16* %_tmp10 to %rec29*
  %_tmp32 = getelementptr %rec29, %rec29* %_tmp31, i16 0, i32 4
  %_tmp33 = bitcast [4 x %rec28]* %_tmp32 to %rec31*
  %_tmp34 = getelementptr %rec31, %rec31* %_tmp33, i16 0, i32 2
  %_tmp36 = bitcast %rec29* %_tmp34 to %rec28*
  br label %bb1.lver.check

bb1.lver.check:                                   ; preds = %0
  %bc = bitcast i16* undef to i8*
  %bc1 = bitcast i16* %_tmp46 to i8*
[...]

so %_tmp46 is indeed used before its definition.

The was introduced in r264243

    [LAA] Support memchecks involving loop-invariant addresses</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>