<html>
    <head>
      <base href="http://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 --- - can't delete empty, terminating, strided loop"
   href="http://llvm.org/bugs/show_bug.cgi?id=19183">19183</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>can't delete empty, terminating, strided loop
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>richard-llvm@metafoo.co.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We can't delete the trivial terminating empty loop in this code:

void f(unsigned k) {
  for (unsigned n = 0; n != (k & -32); n += 32) {
  }
}

The above results in this IR at -O3:

define void @_Z1fj(i32 %k) #0 {
entry:
  %and = and i32 %k, -32
  br label %for.cond

for.cond:                                         ; preds = %for.cond, %entry
  %n.0 = phi i32 [ 0, %entry ], [ %add, %for.cond ]
  %cmp = icmp eq i32 %n.0, %and
  %add = add i32 %n.0, 32
  br i1 %cmp, label %for.end, label %for.cond

for.end:                                          ; preds = %for.cond
  ret void
}

Such loop structures are created by the vectorizer.</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>