aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-05 08:09:48 +0000
committerChris Lattner <sabre@nondot.org>2009-01-05 08:09:48 +0000
commit4a1c4a414ca8ab087dd365eb2e5421ee8535c7ae (patch)
tree416ab4c9e5f5bfa9e788aae5ba5f46269e6eb63b
parentd77d04c323f856b07c6e46450e7578dd09c0165f (diff)
downloadexternal_llvm-4a1c4a414ca8ab087dd365eb2e5421ee8535c7ae.zip
external_llvm-4a1c4a414ca8ab087dd365eb2e5421ee8535c7ae.tar.gz
external_llvm-4a1c4a414ca8ab087dd365eb2e5421ee8535c7ae.tar.bz2
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 ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61680 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AsmParser/LLParser.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 681a662..6894639 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/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;