summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2004-06-23 00:25:35 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2004-06-23 00:25:35 +0000
commit1ea8447089a1b71373ea00473f5d453e143fc251 (patch)
tree386371f4f18953ee178bad095e50426980792c86 /llvm/lib/Transforms/Utils/Local.cpp
parenta9a969676733d47728ff66eeeba5afbebb16393d (diff)
downloadbcm5719-llvm-1ea8447089a1b71373ea00473f5d453e143fc251.tar.gz
bcm5719-llvm-1ea8447089a1b71373ea00473f5d453e143fc251.zip
Use new IsNAN() wrapper.
llvm-svn: 14340
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 677a7dcc1ca..41454ae0cb1 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
+#include "Support/MathExtras.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/Constants.h"
#include "llvm/Instructions.h"
@@ -20,18 +21,6 @@
#include <cmath>
using namespace llvm;
-#if 0
-#if defined(__POWERPC__) && defined(__APPLE_CC__)
-// FIXME: Currently it seems that isnan didn't make its way into the Apple
-// C++ headers, although it IS in the C headers (which confuses autoconf
-// in a big way). This is a quick fix to get things compiling, until one of
-// us has time to write a more complicated autoconf test.
-extern "C" int isnan (double d);
-namespace std { int isnan (double d) { return ::isnan (d); } }
-#endif
-
-#endif
-
//===----------------------------------------------------------------------===//
// Local constant propagation...
//
@@ -303,11 +292,9 @@ Constant *llvm::ConstantFoldCall(Function *F,
if (ConstantFP *Op2 = dyn_cast<ConstantFP>(Operands[1])) {
double Op1V = Op1->getValue(), Op2V = Op2->getValue();
-#if 0
if (Name == "llvm.isunordered")
- return ConstantBool::get(std::isnan(Op1V) | std::isnan(Op2V));
+ return ConstantBool::get(IsNAN(Op1V) || IsNAN(Op2V));
else
-#endif
if (Name == "pow") {
errno = 0;
double V = pow(Op1V, Op2V);
OpenPOWER on IntegriCloud