diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 1337ef2242b..1292297d516 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1614,6 +1614,9 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { unsigned NumElem = StVT.getVectorNumElements(); unsigned ScalarSize = StVT.getScalarType().getSizeInBits(); + EVT EltVT = EVT::getIntegerVT(*DAG.getContext(), ScalarSize); + assert(TLI.isTypeLegal(EltVT) && "Scalar store type must be legal"); + // Round odd types to the next pow of two. if (!isPowerOf2_32(ScalarSize)) ScalarSize = NextPowerOf2(ScalarSize); @@ -1625,17 +1628,14 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { for (unsigned Idx=0; IdxgetPointerInfo().getWithOffset(Idx*Stride), - isVolatile, isNonTemporal, Alignment); + ST->getPointerInfo().getWithOffset(Idx*Stride), + isVolatile, isNonTemporal, Alignment); Stores.push_back(Store); } Result = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, @@ -1663,7 +1663,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { for (unsigned Idx=0; IdxgetPointerInfo().getWithOffset(Idx*Stride), - isVolatile, isNonTemporal, Alignment); + ST->getPointerInfo().getWithOffset(Idx*Stride), + isVolatile, isNonTemporal, Alignment); Stores.push_back(Store); } }