[LLVMbugs] [Bug 21369] New: Loop vectorization does not deal with a simple char reduction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 24 06:50:31 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=21369

            Bug ID: 21369
           Summary: Loop vectorization does not deal with a simple char
                    reduction
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: james.molloy at arm.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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.

-- 
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/20141024/e44acb09/attachment.html>


More information about the llvm-bugs mailing list