<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 - [LV] expandBounds generates wrong runtime checks"
   href="https://bugs.llvm.org/show_bug.cgi?id=50686">50686</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[LV] expandBounds generates wrong runtime checks
          </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>All
          </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>Loop Optimizer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>chenmindong1@huawei.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>void m(int *p, int *p2, int q) {
  {
    int *a = p2;
    for (; k < q; k++)
      a[k] = 2;
  }
  int *a = p;
  int i, j, r;
  i = 0;
  for (; i < 63; i++) {
    r = j = 0;
    for (; j < 63; j++)
      r -= p2[j];
    a[i] = r;
  }
}

Compiled with `clang -O3`, the inner loop will be fully unrolled, and LV
determines it's possible to vectorize the outer loop with runtime checks.
However, the runtime checks generated are incorrect in that the range generated
for the `p2` group is [p2+62, p2+63) rather than [p2, p2+63).</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>