fix two issues Neil noticed, thanks!
authorChris Lattner <sabre@nondot.org>
Tue, 20 May 2008 03:50:52 +0000 (03:50 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 20 May 2008 03:50:52 +0000 (03:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51296 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index 82d9fa87432018780ade7818c8b029e1fc13e028..b7a403d8e9b8a50b6aa04c17ff79379089eb2697 100644 (file)
@@ -5435,7 +5435,7 @@ Instruction *InstCombiner::FoldFCmp_IntToFP_Cst(FCmpInst &I,
   
   // Now we know that the APFloat is a normal number, zero or inf.
   
-  // See if the FP constant is top large for the integer.  For example,
+  // See if the FP constant is too large for the integer.  For example,
   // comparing an i8 to 300.0.
   unsigned IntWidth = IntTy->getPrimitiveSizeInBits();
   
@@ -5561,10 +5561,10 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
       if (CFP->getValueAPF().isNaN()) {
         if (FCmpInst::isOrdered(I.getPredicate()))   // True if ordered and...
           return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty, 0));
-        if (FCmpInst::isUnordered(I.getPredicate())) // True if unordered or...
-          return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty, 1));
-        if (FCmpInst::isUnordered(I.getPredicate())) // Undef on unordered.
-          return ReplaceInstUsesWith(I, UndefValue::get(Type::Int1Ty));
+        assert(FCmpInst::isUnordered(I.getPredicate()) &&
+               "Comparison must be either ordered or unordered!");
+        // True if unordered.
+        return ReplaceInstUsesWith(I, ConstantInt::get(Type::Int1Ty, 1));
       }
     }