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

Chris Lattner sabre at nondot.org
Mon Jan 5 00:09:48 PST 2009


Author: lattner
Date: Mon Jan  5 02:09:48 2009
New Revision: 61680

URL: http://llvm.org/viewvc/llvm-project?rev=61680&view=rev
Log:
add checking intentionally elided for vfcmp/vicmp since they should really
just be removed.  However, this fixes PR3281:crash04.ll, diagnosing it with:

lvm-as: crash04.ll:2:13: vfcmp requires vector floating point operands
  vfcmp uno double* undef, undef
            ^


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=61680&r1=61679&r2=61680&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Mon Jan  5 02:09:48 2009
@@ -2677,8 +2677,12 @@
       return Error(Loc, "icmp requires integer operands");
     Inst = new ICmpInst(CmpInst::Predicate(Pred), LHS, RHS);
   } else if (Opc == Instruction::VFCmp) {
+    if (!LHS->getType()->isFPOrFPVector() || !isa<VectorType>(LHS->getType()))
+      return Error(Loc, "vfcmp requires vector floating point operands");
     Inst = new VFCmpInst(CmpInst::Predicate(Pred), LHS, RHS);
   } else if (Opc == Instruction::VICmp) {
+    if (!LHS->getType()->isIntOrIntVector() || !isa<VectorType>(LHS->getType()))
+      return Error(Loc, "vicmp requires vector floating point operands");
     Inst = new VICmpInst(CmpInst::Predicate(Pred), LHS, RHS);
   }
   return false;





More information about the llvm-commits mailing list