[llvm-commits] [llvm] r50998 - /llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp

Nate Begeman natebegeman at mac.com
Mon May 12 13:33:53 PDT 2008


Author: sampo
Date: Mon May 12 15:33:52 2008
New Revision: 50998

URL: http://llvm.org/viewvc/llvm-project?rev=50998&view=rev
Log:
Simplify some checks

Modified:
    llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp

Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=50998&r1=50997&r2=50998&view=diff

==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon May 12 15:33:52 2008
@@ -818,7 +818,7 @@
 
       if (OpTy->isFloatingPoint())
         V = ConstantExpr::getFCmp(Record[3], Op0, Op1);
-      else if (OpTy->isInteger() || isa<PointerType>(OpTy))
+      else if (!isa<VectorType>(OpTy))
         V = ConstantExpr::getICmp(Record[3], Op0, Op1);
       else if (OpTy->isFPOrFPVector())
         V = ConstantExpr::getVFCmp(Record[3], Op0, Op1);
@@ -1359,10 +1359,10 @@
           OpNum+1 != Record.size())
         return Error("Invalid CMP record");
       
-      if (LHS->getType()->isInteger() || isa<PointerType>(LHS->getType()))
-        I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS);
-      else if (LHS->getType()->isFloatingPoint())
+      if (LHS->getType()->isFloatingPoint())
         I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS);
+      else if (!isa<VectorType>(LHS->getType()))
+        I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS);
       else if (LHS->getType()->isFPOrFPVector())
         I = new VFCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS);
       else





More information about the llvm-commits mailing list