diff options
Diffstat (limited to 'llvm/lib/AsmParser/LLParser.cpp')
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 681a6622b3c..68946393119 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -2677,8 +2677,12 @@ bool LLParser::ParseCompare(Instruction *&Inst, PerFunctionState &PFS, 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; |