@@ -4998,32 +4998,32 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
4998
4998
MVT MaskVT = MVT::getVectorVT(MVT::i1, NumElts);
4999
4999
SDValue SelectMask = DAG.getBuildVector(MaskVT, DL, MaskVals);
5000
5000
5001
- unsigned GatherVVOpc = RISCVISD::VRGATHER_VV_VL;
5002
- MVT IndexVT = VT.changeTypeToInteger();
5003
- // Since we can't introduce illegal index types at this stage, use i16 and
5004
- // vrgatherei16 if the corresponding index type for plain vrgather is greater
5005
- // than XLenVT.
5006
- if (IndexVT.getScalarType().bitsGT(XLenVT)) {
5007
- GatherVVOpc = RISCVISD::VRGATHEREI16_VV_VL;
5008
- IndexVT = IndexVT.changeVectorElementType(MVT::i16);
5009
- }
5010
-
5011
- // If the mask allows, we can do all the index computation in 16 bits. This
5012
- // requires less work and less register pressure at high LMUL, and creates
5013
- // smaller constants which may be cheaper to materialize.
5014
- if (IndexVT.getScalarType().bitsGT(MVT::i16) && isUInt<16>(NumElts - 1) &&
5015
- (IndexVT.getSizeInBits() / Subtarget.getRealMinVLen()) > 1) {
5016
- GatherVVOpc = RISCVISD::VRGATHEREI16_VV_VL;
5017
- IndexVT = IndexVT.changeVectorElementType(MVT::i16);
5018
- }
5019
-
5020
- MVT IndexContainerVT =
5021
- ContainerVT.changeVectorElementType(IndexVT.getScalarType());
5022
-
5023
5001
// Base case for the recursion just below - handle the worst case
5024
5002
// single source permutation. Note that all the splat variants
5025
5003
// are handled above.
5026
5004
if (V2.isUndef()) {
5005
+ unsigned GatherVVOpc = RISCVISD::VRGATHER_VV_VL;
5006
+ MVT IndexVT = VT.changeTypeToInteger();
5007
+ // Since we can't introduce illegal index types at this stage, use i16 and
5008
+ // vrgatherei16 if the corresponding index type for plain vrgather is greater
5009
+ // than XLenVT.
5010
+ if (IndexVT.getScalarType().bitsGT(XLenVT)) {
5011
+ GatherVVOpc = RISCVISD::VRGATHEREI16_VV_VL;
5012
+ IndexVT = IndexVT.changeVectorElementType(MVT::i16);
5013
+ }
5014
+
5015
+ // If the mask allows, we can do all the index computation in 16 bits. This
5016
+ // requires less work and less register pressure at high LMUL, and creates
5017
+ // smaller constants which may be cheaper to materialize.
5018
+ if (IndexVT.getScalarType().bitsGT(MVT::i16) && isUInt<16>(NumElts - 1) &&
5019
+ (IndexVT.getSizeInBits() / Subtarget.getRealMinVLen()) > 1) {
5020
+ GatherVVOpc = RISCVISD::VRGATHEREI16_VV_VL;
5021
+ IndexVT = IndexVT.changeVectorElementType(MVT::i16);
5022
+ }
5023
+
5024
+ MVT IndexContainerVT =
5025
+ ContainerVT.changeVectorElementType(IndexVT.getScalarType());
5026
+
5027
5027
V1 = convertToScalableVector(ContainerVT, V1, DAG, Subtarget);
5028
5028
SmallVector<SDValue> GatherIndicesLHS;
5029
5029
for (int ShuffleIdx : ShuffleMaskLHS)
@@ -5039,7 +5039,7 @@ static SDValue lowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG,
5039
5039
}
5040
5040
5041
5041
// Recursively invoke lowering for each operand if we had two
5042
- // independent single source permutes , and then combine the result via a
5042
+ // independent single source shuffles , and then combine the result via a
5043
5043
// vselect. Note that the vselect will likely be folded back into the
5044
5044
// second permute (vrgather, or other) by the post-isel combine.
5045
5045
V1 = DAG.getVectorShuffle(VT, DL, V1, DAG.getUNDEF(VT), ShuffleMaskLHS);
0 commit comments