<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 - -instcombine with fast flag moves div outside of loop into loop, dramatically regressing performance"
href="https://bugs.llvm.org/show_bug.cgi?id=46115">46115</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-instcombine with fast flag moves div outside of loop into loop, dramatically regressing performance
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>elrodc@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Godbolt:
<a href="https://godbolt.org/z/3vuZbN">https://godbolt.org/z/3vuZbN</a>
The code divides one vector by a scalar.
The unoptimized IR has
inverse = fdiv 1, scalar
and then multiplies one vector by the inverse in the loop.
With -instcombine, the division is moved into the loop.
Seems like a failure of cost modeling not to realize that divisions are far
more expensive.
With vectors of length 128, this leads to about a 5.6-fold regression in
performance on my 10980xe.</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>