[llvm-bugs] [Bug 47862] New: Reduction loop with std::vector not vectorized due to cost model

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 15 10:07:39 PDT 2020


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: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

#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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201015/90e84896/attachment.html>


More information about the llvm-bugs mailing list