[llvm-commits] [llvm] r61685 - /llvm/trunk/lib/AsmParser/LLParser.cpp

Chris Lattner sabre at nondot.org
Mon Jan 5 00:26:05 PST 2009


Author: lattner
Date: Mon Jan  5 02:26:05 2009
New Revision: 61685

URL: http://llvm.org/viewvc/llvm-project?rev=61685&view=rev
Log:
produce the same diagnostics for vicmp constant exprs as vicmp instructions.

Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=61685&r1=61684&r2=61685&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jan  5 02:26:05 2009
@@ -1728,9 +1728,15 @@
       ID.ConstantVal = ConstantExpr::getICmp(Pred, Val0, Val1);
     } else if (Opc == Instruction::VFCmp) {
       // FIXME: REMOVE VFCMP Support
+      if (!Val0->getType()->isFPOrFPVector() ||
+          !isa<VectorType>(Val0->getType()))
+        return Error(ID.Loc, "vfcmp requires vector floating point operands");
       ID.ConstantVal = ConstantExpr::getVFCmp(Pred, Val0, Val1);
     } else if (Opc == Instruction::VICmp) {
-      // FIXME: REMOVE VFCMP Support
+      // FIXME: REMOVE VICMP Support
+      if (!Val0->getType()->isIntOrIntVector() ||
+          !isa<VectorType>(Val0->getType()))
+        return Error(ID.Loc, "vicmp requires vector floating point operands");
       ID.ConstantVal = ConstantExpr::getVICmp(Pred, Val0, Val1);
     }
     ID.Kind = ValID::t_Constant;





More information about the llvm-commits mailing list