<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 - Missed vectorization due to recently added transformation"
href="https://bugs.llvm.org/show_bug.cgi?id=51436">51436</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Missed vectorization due to recently added transformation
</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>Linux
</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>Loop Optimizer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>david.bolvansky@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>unsigned long long foo(unsigned long long a)
{
return (1048575 - a) << 44;
}
void bar(unsigned long long *a)
{
for (int i = 0; i < 8; i++)
a[i] = foo(a[i]);
}
bar is no longer vectorized with LLVM 12+ since that pattern is now rewriten as
mulplication and addition.
LLVM 11:
foo(unsigned long long): # @foo(unsigned long long)
shl rdi, 44
movabs rax, -17592186044416
sub rax, rdi
ret
LLVM 12
foo(unsigned long long): # @foo(unsigned long
long)
movabs rax, -17592186044416
imul rdi, rax
add rax, rdi
ret
LLVM 11:
remark: vectorized loop (vectorization width: 2, interleaved count: 2)
[-Rpass=loop-vectorize]
for (int i = 0; i < N; i++)
LLVM 12:
remark: the cost-model indicates that vectorization is not beneficial
[-Rpass-missed=loop-vectorize]
for (int i = 0; i < N; i++)
So looks like we have some issues in the cost model.
<a href="https://godbolt.org/z/c39qr7nvP">https://godbolt.org/z/c39qr7nvP</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>