<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 vectorization does not deal with a simple char reduction"
   href="http://llvm.org/bugs/show_bug.cgi?id=21369">21369</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Loop vectorization does not deal with a simple char reduction
          </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>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>james.molloy@arm.com
          </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>Clang currently cannot do a simple char reduction. The following program:
char arr[5000];

char f() {
  char a = 0;
  for (int i = 0; i < 5000; ++i)
    a += arr[i];
  return a;
}

Is not vectorized:

/bin/clang -O3 -o - -S test-vec.c -target arm64 -Rpass=loop-vectorize
-Rpass-analysis=loop-vectorize
test-vec.c:8:1: remark: loop not vectorized: value that could not be identified
      as reduction is used outside the loop [-Rpass-analysis=loop-vectorize]
}
^

It is not immediately obvious what value has caused the vectorizer to bail out.</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>