<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - SLP vectorizer produces incorrect x86_64 code"
href="https://bugs.llvm.org/show_bug.cgi?id=50015">50015</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>SLP vectorizer produces incorrect x86_64 code
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>martins.mozeiko@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, pengfei.wang@intel.com, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=24765" name="attach_24765" title="test.c">attachment 24765</a> <a href="attachment.cgi?id=24765&action=edit" title="test.c">[details]</a></span>
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:
<a href="https://github.com/llvm/llvm-project/commit/fcad8d3635cff61a2749dcef94c0d51fa1e3e413">https://github.com/llvm/llvm-project/commit/fcad8d3635cff61a2749dcef94c0d51fa1e3e413</a>
Previous commit produces correct result for attached program.
You can also see difference in assembly & output in following godbolt:
<a href="https://godbolt.org/z/ajehqcTYc">https://godbolt.org/z/ajehqcTYc</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>