<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 --- - Poor -Rpass-analysis=loop-vectorize diagnostic message for (acceptable) failure to vectorize Objective-C fast enumeration loops"
   href="https://llvm.org/bugs/show_bug.cgi?id=28375">28375</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Poor -Rpass-analysis=loop-vectorize diagnostic message for (acceptable) failure to vectorize Objective-C fast enumeration loops
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sean@rogue-research.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16663" name="attach_16663" title="Repro case">attachment 16663</a> <a href="attachment.cgi?id=16663&action=edit" title="Repro case">[details]</a></span>
Repro case

I'm not at all surprised that clang does not autovectorize even simple
Objective-C fast enumeration loops like below:

-------test.m----------
#import <Foundation/Foundation.h>

int main(void)
{
  int sum = 0;
  for (NSNumber* n in @[@1, @2, @3]) {
    sum++;
  }
  return sum;
}
-----------------------

But the diagnostic is poor:

$ clang --version
clang version 3.9.0 (trunk 274259)

$ clang -S -fvectorize -O3 -Rpass-analysis=loop-vectorize ~/Desktop/test.m
/Users/sean/Desktop/test.m:6:2: remark: loop not vectorized: control flow
cannot be substituted for a select [-Rpass-analysis=loop-vectorize]
        for (NSNumber* n in @[@6, @7, @3]) {
        ^

A message like "NSFastEnumeration loops can never be vectorized" would be
better IMHO.</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>