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

            Bug ID: 52128
           Summary: Failure to vectorize accumulation when result is
                    stored in memory
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

void mac(const int *b, int *sum)
{
  int dotp = 0;
  for (int i = 0; i < 32; i++)
    dotp += b[i];

  *sum = dotp;
}

This is not vectorized, but could be. This is done by GCC, but not by LLVM.

PS: Oddly, this can easily be changed to vectorize, but only by making it so
`dotp` is returned instead of stored into memory.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to