<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 --- - Loop vectorizer cannot generate runtime checks for uniform loads"
   href="http://llvm.org/bugs/show_bug.cgi?id=19446">19446</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Loop vectorizer cannot generate runtime checks for uniform loads
          </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>Loop Optimizer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hfinkel@anl.gov
          </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>Created <span class=""><a href="attachment.cgi?id=12382" name="attach_12382" title="test case showing uniform load">attachment 12382</a> <a href="attachment.cgi?id=12382&action=edit" title="test case showing uniform load">[details]</a></span>
test case showing uniform load

Currently, AccessAnalysis::canCheckPtrAtRT calls hasComputableBounds, and
hasComputableBounds has:

  const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(PtrScev);
  if (!AR)
    return false;
  return AR->isAffine();

so we don't generate runtime checks for uniform loads. For example, if the loop
has:

  %12 = load double* %ref3, align 8, !tbaa !4
  %arrayidx = getelementptr inbounds [10000000 x double]* @c, i64 0, i64
%.idx..015
  %13 = load double* %arrayidx, align 8, !tbaa !4
  %mul5 = fmul double %12, %13

where %ref3 is loop invariant, this loop will not vectorize because we won't
generate the necessary runtime check. I've attached a (simple) test case.</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>