produce the same diagnostics for vicmp constant exprs as vicmp instructions.
authorChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 08:26:05 +0000 (08:26 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 5 Jan 2009 08:26:05 +0000 (08:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61685 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/LLParser.cpp

index 1a5a521b69f4651cc27b996c1c00fed8a70438f7..8a686ce2f83a1eb698893348faaca5d3e755d24f 100644 (file)
@@ -1728,9 +1728,15 @@ bool LLParser::ParseValID(ValID &ID) {
       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;