Moved type construction out of the loop and added an assert on the legality of the type. Formatted lines to the 80 char limit.
llvm-svn: 140952
This commit is contained in:
parent
84c287e33c
commit
52e8ed9214
|
@ -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);
|
||||
|
@ -1627,10 +1630,7 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
|
|||
SDValue Ex = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl,
|
||||
WideScalarVT, Tmp3, DAG.getIntPtrConstant(Idx));
|
||||
|
||||
|
||||
EVT NVT = EVT::getIntegerVT(*DAG.getContext(), ScalarSize);
|
||||
|
||||
Ex = DAG.getNode(ISD::TRUNCATE, dl, NVT, Ex);
|
||||
Ex = DAG.getNode(ISD::TRUNCATE, dl, EltVT, Ex);
|
||||
Tmp2 = DAG.getNode(ISD::ADD, dl, Tmp2.getValueType(), Tmp2,
|
||||
DAG.getIntPtrConstant(Stride));
|
||||
SDValue Store = DAG.getStore(Tmp1, dl, Ex, Tmp2,
|
||||
|
|
Loading…
Reference in New Issue