Author: lattner
Date: Wed Oct 24 13:54:45 2007
New Revision: 43305

URL: http://llvm.org/viewvc/llvm-project?rev=43305&view=rev
Log:
simplify some code by using the new isNaN predicate

Modified:
    llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp
URL: 
http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp?rev=43305&r1=43304&r2=43305&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Wed Oct 24 
13:54:45 2007
@@ -3637,8 +3637,7 @@
           if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
             // If either of the constants are nans, then the whole thing 
returns
             // false.
-            if (LHSC->getValueAPF().getCategory() == APFloat::fcNaN ||
-                RHSC->getValueAPF().getCategory() == APFloat::fcNaN)
+            if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN())
               return ReplaceInstUsesWith(I, ConstantInt::getFalse());
             return new FCmpInst(FCmpInst::FCMP_ORD, LHS->getOperand(0),
                                 RHS->getOperand(0));
@@ -4121,8 +4120,7 @@
           if (ConstantFP *RHSC = dyn_cast<ConstantFP>(RHS->getOperand(1))) {
             // If either of the constants are nans, then the whole thing 
returns
             // true.
-            if (LHSC->getValueAPF().getCategory() == APFloat::fcNaN ||
-                RHSC->getValueAPF().getCategory() == APFloat::fcNaN)
+            if (LHSC->getValueAPF().isNaN() || RHSC->getValueAPF().isNaN())
               return ReplaceInstUsesWith(I, ConstantInt::getTrue());
             
             // Otherwise, no need to compare the two constants, compare the


_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to