From cbf26e3b574366fabfda50222817950b85517608 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Sat, 1 Oct 2011 18:39:28 +0000 Subject: [PATCH] Moved type construction out of the loop and added an assert on the legality of the type. Formatted lines to the 80 char limit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140952 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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); } } -- 2.34.1