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

            Bug ID: 47862
           Summary: Reduction loop with std::vector not vectorized due to
                    cost model
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

#include <vector>

std::size_t stdvecsum(std::vector<std::vector<float>> const & v) {
    std::size_t ret = 0;
    for (std::size_t i = 0; i < v.size(); ++i)
      ret += v[i].size();
    return ret;
}

ICC -O3 -mavx2 vectorizes this loop. Clang does not vectorize it due to cost
model.

https://godbolt.org/z/Peds78

-- 
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