[llvm-commits] CVS: llvm/lib/Transforms/Utils/Local.cpp

Brian Gaeke gaeke at cs.uiuc.edu
Tue Jun 22 19:34:01 PDT 2004


Changes in directory llvm/lib/Transforms/Utils:

Local.cpp updated: 1.32 -> 1.33

---
Log message:

Use new IsNAN() wrapper.


---
Diffs of the changes:  (+2 -15)

Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.32 llvm/lib/Transforms/Utils/Local.cpp:1.33
--- llvm/lib/Transforms/Utils/Local.cpp:1.32	Mon Jun 21 01:17:21 2004
+++ llvm/lib/Transforms/Utils/Local.cpp	Tue Jun 22 19:25:35 2004
@@ -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 @@
       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);





More information about the llvm-commits mailing list