Fix the result type of a VECTOR_SHUFFLE+BIT_CONVERT dagcombine. This
authorDan Gohman <gohman@apple.com>
Wed, 16 Jul 2008 16:13:58 +0000 (16:13 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 16 Jul 2008 16:13:58 +0000 (16:13 +0000)
was turned up by some new SelectionDAG assertion checks that I'm
working on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53687 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 581d6ee0426668ae65256c5dec9d0f15794ce0d8..14efb446feade3021fb1d197bca49d6a86b750a3 100644 (file)
@@ -5070,9 +5070,8 @@ SDOperand DAGCombiner::XformToShuffleWithZero(SDNode *N) {
                                 &IdxOps[0], IdxOps.size()));
       SDOperand Result = DAG.getNode(ISD::VECTOR_SHUFFLE, VT,
                                      &Ops[0], Ops.size());
-      if (VT != LHS.getValueType()) {
-        Result = DAG.getNode(ISD::BIT_CONVERT, LHS.getValueType(), Result);
-      }
+      if (VT != N->getValueType(0))
+        Result = DAG.getNode(ISD::BIT_CONVERT, N->getValueType(0), Result);
       return Result;
     }
   }