@@ -4135,8 +4135,7 @@ static SDValue extractSubVector(SDValue Vec, unsigned IdxVal, SelectionDAG &DAG,
4135
4135
isNullConstant(Vec.getOperand(2)))
4136
4136
return DAG.getUNDEF(ResultVT);
4137
4137
4138
- SDValue VecIdx = DAG.getVectorIdxConstant(IdxVal, dl);
4139
- return DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, ResultVT, Vec, VecIdx);
4138
+ return DAG.getExtractSubvector(dl, ResultVT, Vec, IdxVal);
4140
4139
}
4141
4140
4142
4141
/// Generate a DAG to grab 128-bits from a vector > 128 bits. This
@@ -4148,7 +4147,8 @@ static SDValue extractSubVector(SDValue Vec, unsigned IdxVal, SelectionDAG &DAG,
4148
4147
static SDValue extract128BitVector(SDValue Vec, unsigned IdxVal,
4149
4148
SelectionDAG &DAG, const SDLoc &dl) {
4150
4149
assert((Vec.getValueType().is256BitVector() ||
4151
- Vec.getValueType().is512BitVector()) && "Unexpected vector size!");
4150
+ Vec.getValueType().is512BitVector()) &&
4151
+ "Unexpected vector size!");
4152
4152
return extractSubVector(Vec, IdxVal, DAG, dl, 128);
4153
4153
}
4154
4154
@@ -4167,20 +4167,16 @@ static SDValue insertSubVector(SDValue Result, SDValue Vec, unsigned IdxVal,
4167
4167
// Inserting UNDEF is Result
4168
4168
if (Vec.isUndef())
4169
4169
return Result;
4170
- EVT VT = Vec.getValueType();
4171
- EVT ElVT = VT.getVectorElementType();
4172
- EVT ResultVT = Result.getValueType();
4173
4170
4174
4171
// Insert the relevant vectorWidth bits.
4175
- unsigned ElemsPerChunk = vectorWidth/ElVT.getSizeInBits();
4172
+ EVT VT = Vec.getValueType();
4173
+ unsigned ElemsPerChunk = vectorWidth / VT.getScalarSizeInBits();
4176
4174
assert(isPowerOf2_32(ElemsPerChunk) && "Elements per chunk not power of 2");
4177
4175
4178
4176
// This is the index of the first element of the vectorWidth-bit chunk
4179
4177
// we want. Since ElemsPerChunk is a power of 2 just need to clear bits.
4180
4178
IdxVal &= ~(ElemsPerChunk - 1);
4181
-
4182
- SDValue VecIdx = DAG.getVectorIdxConstant(IdxVal, dl);
4183
- return DAG.getNode(ISD::INSERT_SUBVECTOR, dl, ResultVT, Result, Vec, VecIdx);
4179
+ return DAG.getInsertSubvector(dl, Result, Vec, IdxVal);
4184
4180
}
4185
4181
4186
4182
/// Generate a DAG to put 128-bits into a vector > 128 bits. This
@@ -4216,8 +4212,7 @@ static SDValue widenSubVector(MVT VT, SDValue Vec, bool ZeroNewElements,
4216
4212
}
4217
4213
SDValue Res = ZeroNewElements ? getZeroVector(VT, Subtarget, DAG, dl)
4218
4214
: DAG.getUNDEF(VT);
4219
- return DAG.getNode(ISD::INSERT_SUBVECTOR, dl, VT, Res, Vec,
4220
- DAG.getVectorIdxConstant(0, dl));
4215
+ return DAG.getInsertSubvector(dl, Res, Vec, 0);
4221
4216
}
4222
4217
4223
4218
/// Widen a vector to a larger size with the same scalar type, with the new
0 commit comments