@@ -15307,18 +15307,19 @@ performCONCAT_VECTORSSplitCombine(SDNode *N, SelectionDAG &DAG,
15307
15307
MVT VT = N->getSimpleValueType(0);
15308
15308
15309
15309
MVT HalfVT = VT.getHalfNumVectorElementsVT();
15310
- size_t HalfNumOps = (N->getNumOperands() + 1) / 2;
15311
- SDValue BotSubConcat = DAG.getNode(ISD::CONCAT_VECTORS, DL, HalfVT,
15312
- N->ops().take_front(HalfNumOps));
15313
- SDValue TopSubConcat = DAG.getNode(ISD::CONCAT_VECTORS, DL, HalfVT,
15314
- N->ops().drop_front(HalfNumOps));
15310
+ assert(isPowerOf2_32(N->getNumOperands()));
15311
+ size_t HalfNumOps = N->getNumOperands() / 2;
15312
+ SDValue Lo = DAG.getNode(ISD::CONCAT_VECTORS, DL, HalfVT,
15313
+ N->ops().take_front(HalfNumOps));
15314
+ SDValue Hi = DAG.getNode(ISD::CONCAT_VECTORS, DL, HalfVT,
15315
+ N->ops().drop_front(HalfNumOps));
15315
15316
15316
15317
// Lower to an insert_subvector directly so the concat_vectors don't get
15317
15318
// recombined.
15318
- SDValue Vec = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, VT, DAG.getUNDEF(VT),
15319
- BotSubConcat, DAG.getVectorIdxConstant(0, DL));
15319
+ SDValue Vec = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, VT, DAG.getUNDEF(VT), Lo,
15320
+ DAG.getVectorIdxConstant(0, DL));
15320
15321
Vec = DAG.getNode(
15321
- ISD::INSERT_SUBVECTOR, DL, VT, Vec, TopSubConcat ,
15322
+ ISD::INSERT_SUBVECTOR, DL, VT, Vec, Hi ,
15322
15323
DAG.getVectorIdxConstant(HalfVT.getVectorMinNumElements(), DL));
15323
15324
return Vec;
15324
15325
}
0 commit comments