<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - IR for isfinite() could be improved?"
href="https://llvm.org/bugs/show_bug.cgi?id=27145">27145</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>IR for isfinite() could be improved?
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Transformation Utilities
</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>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#include <math.h>
#include <stdbool.h>
bool foo(float x) { return isfinite(x); }
$ ./clang -O1 isnan.c -S -o - -emit-llvm
...
define zeroext i1 @foo(float %x) #0 {
entry:
%cmp.i = fcmp ord float %x, 0.000000e+00
%0 = tail call float @llvm.fabs.f32(float %x) #2
%cmp1.i = fcmp une float %0, 0x7FF0000000000000
%1 = and i1 %cmp.i, %cmp1.i
ret i1 %1
}
Can't we use 'fcmp one' here to eliminate the first compare?
"one: ordered and not equal"</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>