[llvm-bugs] [Bug 46890] New: Loop vectorizer does not account for incremented pointers

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 29 05:20:44 PDT 2020


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

            Bug ID: 46890
           Summary: Loop vectorizer does not account for incremented
                    pointers
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: opt
          Assignee: unassignedbugs at nondot.org
          Reporter: joel.hutton at arm.com
                CC: llvm-bugs at lists.llvm.org

The following snippet:

void foo(char restrict d, char restrict s1, char* restrict s2) {
  for (int y = 0; y < 128; y++) {
    for (int i = 0; i < 16; i++) {
      d[i] = s1[i] + s2[i];
    }
    d += 16;
  }
}

cannot be vectorized by LLVM trunk, however writing the same snippet in terms
of a constant base pointer (array index i+16*y ) can be vectorized. This
snippet can be vectorized by GCC trunk. Support for this pattern was added to
GCC in GCC 10.

This affects SPEC2017 performance.

Tested on aarch64-linux

-- 
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/20200729/54f902d5/attachment.html>


More information about the llvm-bugs mailing list