<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 - Loop unrolling breaks vectorization"
   href="https://bugs.llvm.org/show_bug.cgi?id=35448">35448</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Loop unrolling breaks vectorization
          </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>sanjoy@playingwithpointers.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Perhaps this is already a known issue, but Clang/LLVM trunk does not vectorize
the inner matmult loop unless the "#pragma unroll" is enabled:

void f(int * __restrict__ a, int * __restrict__ b, int * __restrict__ r) {
  for (int m = 0; m < 64; m++) {
    int c = 0;
    // #pragma unroll
    for (int i = 0; i < 32; i++) {
      c += a[i] * b[m * 32 + i];
    }
    r[m] = c;
  }
}

It looks like the loop unroller fully unrolls the inner loop and the SLP
vectorizer is unable to vectorize as well as the Loop vectorizer would have
vectorized the not-unrolled loop.</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>