[llvm-bugs] [Bug 50015] New: SLP vectorizer produces incorrect x86_64 code

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Apr 17 21:56:39 PDT 2021


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

            Bug ID: 50015
           Summary: SLP vectorizer produces incorrect x86_64 code
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: martins.mozeiko at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, pengfei.wang at intel.com,
                    spatel+llvm at rotateright.com

Created attachment 24765
  --> https://bugs.llvm.org/attachment.cgi?id=24765&action=edit
test.c

Clang v12 produces incorrect x86_64 code for attached program when slp
vectorizer is enabled (by default) with "-O2".

If you compile with Clang v12 using "-O1" the produced code is correct.
Compiling with Clang v12 using "-O2 -fno-slp-vectorize" also produces correct
code.
Using Clang v11 with "-O2" also produces correct code.

I bisected llvm repo to this commit:
https://github.com/llvm/llvm-project/commit/fcad8d3635cff61a2749dcef94c0d51fa1e3e413
Previous commit produces correct result for attached program.

You can also see difference in assembly & output in following godbolt:
https://godbolt.org/z/ajehqcTYc

-- 
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/20210418/de90063b/attachment.html>


More information about the llvm-bugs mailing list