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

Alkis Evlogimenos alkis at cs.uiuc.edu
Sat Jun 12 20:30:01 PDT 2004


Changes in directory llvm/lib/Transforms/Utils:

Local.cpp updated: 1.25 -> 1.26

---
Log message:

Add constant folding capabilities to the isunordered intrinsic.


---
Diffs of the changes:  (+4 -1)

Index: llvm/lib/Transforms/Utils/Local.cpp
diff -u llvm/lib/Transforms/Utils/Local.cpp:1.25 llvm/lib/Transforms/Utils/Local.cpp:1.26
--- llvm/lib/Transforms/Utils/Local.cpp:1.25	Fri Jun 11 01:16:23 2004
+++ llvm/lib/Transforms/Utils/Local.cpp	Sat Jun 12 20:23:56 2004
@@ -238,6 +238,7 @@
 
   switch (F->getIntrinsicID()) {
   case Intrinsic::isnan: return true;
+  case Intrinsic::isunordered: return true;
   default: break;
   }
 
@@ -293,7 +294,9 @@
       if (ConstantFP *Op2 = dyn_cast<ConstantFP>(Operands[1])) {
         double Op1V = Op1->getValue(), Op2V = Op2->getValue();
 
-        if (Name == "pow") {
+        if (Name == "llvm.isunordered")
+          return ConstantBool::get(isnan(Op1V) | isnan(Op2V));
+        else if (Name == "pow") {
           errno = 0;
           double V = pow(Op1V, Op2V);
           if (errno == 0)





More information about the llvm-commits mailing list