From ae95d72a5296961cc4ec04cc87c3753653f6f3b1 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 29 Oct 2007 20:44:42 +0000 Subject: Fix a DAGCombiner abort on a bitcast from a scalar to a vector. llvm-svn: 43470 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index b4299f4ff85..b423d68e0f0 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4212,7 +4212,8 @@ SDOperand DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) { unsigned NumElts = MVT::getVectorNumElements(VT); if (InVec.getOpcode() == ISD::BIT_CONVERT) { MVT::ValueType BCVT = InVec.getOperand(0).getValueType(); - if (NumElts != MVT::getVectorNumElements(BCVT)) + if (!MVT::isVector(BCVT) || + NumElts != MVT::getVectorNumElements(BCVT)) return SDOperand(); InVec = InVec.getOperand(0); EVT = MVT::getVectorElementType(BCVT); -- cgit v1.2.3