<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 --- - [SLP] Missed opportunity to generate min/max reduction for fully unrolled loop"
   href="https://llvm.org/bugs/show_bug.cgi?id=26956">26956</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SLP] Missed opportunity to generate min/max reduction for fully unrolled 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>Windows NT
          </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>mcrosier@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>anemet@apple.com, hfinkel@anl.gov, llvm-bugs@lists.llvm.org, mssimpso@codeaurora.org, nrotem@apple.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre># define MAX(x,y) ((x)>(y)?(x):(y))

double arr[16];
double bar() {
  double max = arr[0];
  for (int i = 1; i < 16; ++i)
    max = MAX(max, arr[i]);
  return max;
}

Given the above code, LLVM currently fully unrolls the loop and the SLP
vectorizer is unable to vectorize the resulting code.  If we replace the
constant 16 with an unknown trip count the loop vectorizer will catch this
case.

Please feel free to provide feedback as I'd like to solve this problem, but I
have no experience with the SLP 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>