[llvm-bugs] [Bug 27145] New: IR for isfinite() could be improved?
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Mar 30 15:10:43 PDT 2016
https://llvm.org/bugs/show_bug.cgi?id=27145
Bug ID: 27145
Summary: IR for isfinite() could be improved?
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Transformation Utilities
Assignee: unassignedbugs at nondot.org
Reporter: spatel+llvm at rotateright.com
CC: llvm-bugs at lists.llvm.org
Classification: Unclassified
#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"
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160330/73c914e1/attachment.html>
More information about the llvm-bugs
mailing list