From: Chris Lattner Date: Mon, 29 Dec 2008 00:16:12 +0000 (+0000) Subject: select constant exprs should have the same constraints as select instructions, X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9ace0cdb12be5e9c213567209ace721dfeccaddf;p=oota-llvm.git select constant exprs should have the same constraints as select instructions, notably, they should support vectors and aggregates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61462 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 5fc08dc900e..4e3b840c913 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -2111,9 +2111,7 @@ Constant *ConstantExpr::getCompare(unsigned short pred, Constant *ConstantExpr::getSelectTy(const Type *ReqTy, Constant *C, Constant *V1, Constant *V2) { - assert(C->getType() == Type::Int1Ty && "Select condition must be i1!"); - assert(V1->getType() == V2->getType() && "Select value types must match!"); - assert(V1->getType()->isFirstClassType() && "Cannot select aggregate type!"); + assert(!SelectInst::areInvalidOperands(C, V1, V2)&&"Invalid select operands"); if (ReqTy == V1->getType()) if (Constant *SC = ConstantFoldSelectInstruction(C, V1, V2))