<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 - use SDNodeFlags to enable reciprocal square root transform"
href="https://bugs.llvm.org/show_bug.cgi?id=34558">34558</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>use SDNodeFlags to enable reciprocal square root transform
</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>All
</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>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>spatel+llvm@rotateright.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Given IR with fast-math-flags, those attributes should be passed on to the
corresponding FP nodes in the DAG:
define float @fast_recip_sqrt(float %x) {
%y = call fast float @llvm.sqrt.f32(float %x)
%z = fdiv fast float 1.0, %y
ret float %z
}
declare float @llvm.sqrt.f32(float) nounwind readonly
-------------------------------------------------------------------------------
For x86, this should trigger a reciprocal square root estimate optimization:
rsqrtss %xmm0, %xmm1
mulss %xmm1, %xmm0
mulss %xmm1, %xmm0
addss LCPI0_0(%rip), %xmm0
mulss LCPI0_1(%rip), %xmm1
mulss %xmm1, %xmm0
retq
There are currently 2 problems:
1. We don't apply FMF to intrinsics ( <a href="https://reviews.llvm.org/D37686">https://reviews.llvm.org/D37686</a> proposes
to fix this), so the sqrt node isn't marked with any relaxed FP properties.
2. The code in DAGCombiner::visitFDIV() doesn't check flags on nodes.</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>