[llvm-bugs] [Bug 28375] New: Poor -Rpass-analysis=loop-vectorize diagnostic message for (acceptable) failure to vectorize Objective-C fast enumeration loops

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 30 12:11:50 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=28375

            Bug ID: 28375
           Summary: Poor -Rpass-analysis=loop-vectorize diagnostic message
                    for (acceptable) failure to vectorize Objective-C fast
                    enumeration loops
           Product: new-bugs
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: sean at rogue-research.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16663
  --> https://llvm.org/bugs/attachment.cgi?id=16663&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160630/891315cc/attachment.html>


More information about the llvm-bugs mailing list