@@ -29773,35 +29773,34 @@ SDValue AArch64TargetLowering::LowerFixedLengthVECTOR_SHUFFLEToSVE(
2977329773 return convertFromScalableVector(DAG, VT, Op);
2977429774 }
2977529775
29776- auto lowerToRevMergePassthru = [&](unsigned Opcode, SDValue Vec,
29777- EVT PredVecVT, EVT RevVT) {
29778- auto Pg = getPredicateForVector(DAG, DL, PredVecVT);
29779- SDValue RevOp = DAG.getNode(ISD::BITCAST, DL, RevVT, Vec);
29780- auto Rev = DAG.getNode(Opcode, DL, RevVT, Pg, RevOp, DAG.getUNDEF(RevVT));
29781- auto Cast = DAG.getNode(ISD::BITCAST, DL, ContainerVT, Rev);
29782- return convertFromScalableVector(DAG, VT, Cast);
29783- };
29784-
2978529776 unsigned EltSize = VT.getScalarSizeInBits();
29786- for (unsigned LaneSize : {64U, 32U, 16U}) {
29787- if (isREVMask(ShuffleMask, EltSize, VT.getVectorNumElements(), LaneSize )) {
29777+ for (unsigned BlockSize : {64U, 32U, 16U}) {
29778+ if (isREVMask(ShuffleMask, EltSize, VT.getVectorNumElements(), BlockSize )) {
2978829779 unsigned RevOp;
2978929780 if (EltSize == 8)
2979029781 RevOp = AArch64ISD::BSWAP_MERGE_PASSTHRU;
2979129782 else if (EltSize == 16)
2979229783 RevOp = AArch64ISD::REVH_MERGE_PASSTHRU;
2979329784 else
2979429785 RevOp = AArch64ISD::REVW_MERGE_PASSTHRU;
29795- EVT NewVT =
29796- getPackedSVEVectorVT(EVT::getIntegerVT(*DAG.getContext(), LaneSize));
29797- return lowerToRevMergePassthru(RevOp, Op1, NewVT, NewVT);
29786+ EVT BlockedVT =
29787+ getPackedSVEVectorVT(EVT::getIntegerVT(*DAG.getContext(), BlockSize));
29788+ SDValue Pg = getPredicateForVector(DAG, DL, BlockedVT);
29789+ SDValue BlockedOp1 = DAG.getNode(ISD::BITCAST, DL, BlockedVT, Op1);
29790+ SDValue BlockedRev = DAG.getNode(RevOp, DL, BlockedVT, Pg, BlockedOp1,
29791+ DAG.getUNDEF(BlockedVT));
29792+ SDValue Container =
29793+ DAG.getNode(ISD::BITCAST, DL, ContainerVT, BlockedRev);
29794+ return convertFromScalableVector(DAG, VT, Container);
2979829795 }
2979929796 }
2980029797
2980129798 if (Subtarget->hasSVE2p1() && EltSize == 64 &&
2980229799 isREVMask(ShuffleMask, EltSize, VT.getVectorNumElements(), 128)) {
29803- return lowerToRevMergePassthru(AArch64ISD::REVD_MERGE_PASSTHRU, Op1, VT,
29804- ContainerVT);
29800+ SDValue Pg = getPredicateForVector(DAG, DL, VT);
29801+ SDValue Revd = DAG.getNode(AArch64ISD::REVD_MERGE_PASSTHRU, DL, ContainerVT,
29802+ Pg, Op1, DAG.getUNDEF(ContainerVT));
29803+ return convertFromScalableVector(DAG, VT, Revd);
2980529804 }
2980629805
2980729806 unsigned WhichResult;
0 commit comments