@@ -21008,8 +21008,8 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) {
21008
21008
if (N0.isUndef() && N1.getOpcode() == ISD::BITCAST &&
21009
21009
N1.getOperand(0).getOpcode() == ISD::EXTRACT_SUBVECTOR &&
21010
21010
N1.getOperand(0).getOperand(1) == N2 &&
21011
- N1.getOperand(0).getOperand(0).getValueType().getVectorNumElements () ==
21012
- VT.getVectorNumElements () &&
21011
+ N1.getOperand(0).getOperand(0).getValueType().getVectorElementCount () ==
21012
+ VT.getVectorElementCount () &&
21013
21013
N1.getOperand(0).getOperand(0).getValueType().getSizeInBits() ==
21014
21014
VT.getSizeInBits()) {
21015
21015
return DAG.getBitcast(VT, N1.getOperand(0).getOperand(0));
@@ -21026,7 +21026,7 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) {
21026
21026
EVT CN1VT = CN1.getValueType();
21027
21027
if (CN0VT.isVector() && CN1VT.isVector() &&
21028
21028
CN0VT.getVectorElementType() == CN1VT.getVectorElementType() &&
21029
- CN0VT.getVectorNumElements () == VT.getVectorNumElements ()) {
21029
+ CN0VT.getVectorElementCount () == VT.getVectorElementCount ()) {
21030
21030
SDValue NewINSERT = DAG.getNode(ISD::INSERT_SUBVECTOR, SDLoc(N),
21031
21031
CN0.getValueType(), CN0, CN1, N2);
21032
21032
return DAG.getBitcast(VT, NewINSERT);
@@ -21107,8 +21107,10 @@ SDValue DAGCombiner::visitINSERT_SUBVECTOR(SDNode *N) {
21107
21107
// If the input vector is a concatenation, and the insert replaces
21108
21108
// one of the pieces, we can optimize into a single concat_vectors.
21109
21109
if (N0.getOpcode() == ISD::CONCAT_VECTORS && N0.hasOneUse() &&
21110
- N0.getOperand(0).getValueType() == N1.getValueType()) {
21111
- unsigned Factor = N1.getValueType().getVectorNumElements();
21110
+ N0.getOperand(0).getValueType() == N1.getValueType() &&
21111
+ N0.getOperand(0).getValueType().isScalableVector() ==
21112
+ N1.getValueType().isScalableVector()) {
21113
+ unsigned Factor = N1.getValueType().getVectorMinNumElements();
21112
21114
SmallVector<SDValue, 8> Ops(N0->op_begin(), N0->op_end());
21113
21115
Ops[InsIdx / Factor] = N1;
21114
21116
return DAG.getNode(ISD::CONCAT_VECTORS, SDLoc(N), VT, Ops);
0 commit comments