Fix thinko - the operand number has nothing to do
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAG.cpp
index 2ad3da038771ccf1951ac4a41bf1d5235370e061..758f112f78c6e83e4318b50f7c67da32ed994792 100644 (file)
@@ -797,10 +797,14 @@ void SelectionDAG::VerifyNode(SDNode *N) {
     assert(N->getValueType(0).isVector() && "Wrong BUILD_VECTOR return type!");
     assert(N->getNumOperands() == N->getValueType(0).getVectorNumElements() &&
            "Wrong number of BUILD_VECTOR operands!");
-    MVT EltVT = N->getValueType(0).getVectorElementType();
-    for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I)
-      assert(I->getSDValue().getValueType() == EltVT &&
-             "Wrong BUILD_VECTOR operand type!");
+    // FIXME: Change vector_shuffle to a variadic node with mask elements being
+    // operands of the node.  Currently the mask is a BUILD_VECTOR passed as an
+    // operand, and it is not always possible to legalize it.  Turning off the
+    // following checks at least makes it possible to legalize most of the time.
+//    MVT EltVT = N->getValueType(0).getVectorElementType();
+//    for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); I != E; ++I)
+//      assert(I->getSDValue().getValueType() == EltVT &&
+//             "Wrong BUILD_VECTOR operand type!");
     break;
   }
   }
@@ -974,7 +978,7 @@ SDValue SelectionDAG::getGlobalAddress(const GlobalValue *GV,
   unsigned Opc;
 
   // Truncate (with sign-extension) the offset value to the pointer size.
-  unsigned BitWidth = VT.getSizeInBits();
+  unsigned BitWidth = TLI.getPointerTy().getSizeInBits();
   if (BitWidth < 64)
     Offset = (Offset << (64 - BitWidth) >> (64 - BitWidth));