[llvm-commits] [llvm] r61462 - /llvm/trunk/lib/VMCore/Constants.cpp
Chris Lattner
sabre at nondot.org
Sun Dec 28 16:16:13 PST 2008
Author: lattner
Date: Sun Dec 28 18:16:12 2008
New Revision: 61462
URL: http://llvm.org/viewvc/llvm-project?rev=61462&view=rev
Log:
select constant exprs should have the same constraints as select instructions,
notably, they should support vectors and aggregates.
Modified:
llvm/trunk/lib/VMCore/Constants.cpp
Modified: llvm/trunk/lib/VMCore/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Constants.cpp?rev=61462&r1=61461&r2=61462&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Constants.cpp (original)
+++ llvm/trunk/lib/VMCore/Constants.cpp Sun Dec 28 18:16:12 2008
@@ -2111,9 +2111,7 @@
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))
More information about the llvm-commits
mailing list