@@ -3517,12 +3517,12 @@ static SDValue matchSplatAsGather(SDValue SplatVal, MVT VT, const SDLoc &DL,
3517
3517
const RISCVSubtarget &Subtarget) {
3518
3518
if (SplatVal.getOpcode() != ISD::EXTRACT_VECTOR_ELT)
3519
3519
return SDValue();
3520
- SDValue Vec = SplatVal.getOperand(0);
3520
+ SDValue Src = SplatVal.getOperand(0);
3521
3521
// Don't perform this optimization for i1 vectors, or if the element types are
3522
3522
// different
3523
3523
// FIXME: Support i1 vectors, maybe by promoting to i8?
3524
3524
MVT EltTy = VT.getVectorElementType();
3525
- MVT SrcVT = Vec .getSimpleValueType();
3525
+ MVT SrcVT = Src .getSimpleValueType();
3526
3526
if (EltTy == MVT::i1 || EltTy != SrcVT.getVectorElementType())
3527
3527
return SDValue();
3528
3528
SDValue Idx = SplatVal.getOperand(1);
@@ -3545,29 +3545,26 @@ static SDValue matchSplatAsGather(SDValue SplatVal, MVT VT, const SDLoc &DL,
3545
3545
MVT SrcContainerVT = SrcVT;
3546
3546
if (SrcVT.isFixedLengthVector()) {
3547
3547
SrcContainerVT = getContainerForFixedLengthVector(DAG, SrcVT, Subtarget);
3548
- Vec = convertToScalableVector(SrcContainerVT, Vec , DAG, Subtarget);
3548
+ Src = convertToScalableVector(SrcContainerVT, Src , DAG, Subtarget);
3549
3549
}
3550
3550
3551
3551
// Put Vec in a VT sized vector
3552
3552
if (SrcContainerVT.getVectorMinNumElements() <
3553
3553
ContainerVT.getVectorMinNumElements())
3554
- Vec = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, ContainerVT,
3555
- DAG.getUNDEF(ContainerVT), Vec ,
3554
+ Src = DAG.getNode(ISD::INSERT_SUBVECTOR, DL, ContainerVT,
3555
+ DAG.getUNDEF(ContainerVT), Src ,
3556
3556
DAG.getVectorIdxConstant(0, DL));
3557
3557
else
3558
- Vec = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, ContainerVT, Vec ,
3558
+ Src = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, ContainerVT, Src ,
3559
3559
DAG.getVectorIdxConstant(0, DL));
3560
3560
3561
3561
// We checked that Idx fits inside VT earlier
3562
3562
auto [Mask, VL] = getDefaultVLOps(VT, ContainerVT, DL, DAG, Subtarget);
3563
-
3564
- SDValue Gather = DAG.getNode(RISCVISD::VRGATHER_VX_VL, DL, ContainerVT, Vec,
3563
+ SDValue Gather = DAG.getNode(RISCVISD::VRGATHER_VX_VL, DL, ContainerVT, Src,
3565
3564
Idx, DAG.getUNDEF(ContainerVT), Mask, VL);
3566
-
3567
- if (!VT.isFixedLengthVector())
3568
- return Gather;
3569
-
3570
- return convertFromScalableVector(VT, Gather, DAG, Subtarget);
3565
+ if (VT.isFixedLengthVector())
3566
+ Gather = convertFromScalableVector(VT, Gather, DAG, Subtarget);
3567
+ return Gather;
3571
3568
}
3572
3569
3573
3570
/// Try and optimize BUILD_VECTORs with "dominant values" - these are values
0 commit comments