Fix a bug in DAGcombiner about zero-extend after setcc.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / DAGCombiner.cpp
index 68d0521e7630a9a76686ea740d33b617d2793994..3b87922b7897fad8d2c5c3b3d5cfe80e4dadbb01 100644 (file)
@@ -4970,7 +4970,8 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) {
   }
 
   if (N0.getOpcode() == ISD::SETCC) {
-    if (!LegalOperations && VT.isVector()) {
+    if (!LegalOperations && VT.isVector() &&
+        N0.getValueType().getVectorElementType() == MVT::i1) {
       // zext(setcc) -> (and (vsetcc), (1, 1, ...) for vectors.
       // Only do this before legalize for now.
       EVT N0VT = N0.getOperand(0).getValueType();