Skip to content

Commit d84396c

Browse files
committed
[RISCV] Remove dead code handling fixed-length vectors after DAG legalization
1 parent 0da5f8c commit d84396c

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17397,21 +17397,12 @@ static SDValue combineSHL(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
1739717397
return SDValue();
1739817398

1739917399
SelectionDAG &DAG = DCI.DAG;
17400-
MVT NarrowContainerVT = NarrowVT;
17401-
MVT ContainerVT = VT;
1740217400
SDLoc DL(N);
1740317401
SDValue Passthru, Mask, VL;
1740417402
switch (N->getOpcode()) {
1740517403
case ISD::SHL:
17406-
if (VT.isFixedLengthVector()) {
17407-
NarrowContainerVT =
17408-
getContainerForFixedLengthVector(DAG, NarrowVT, Subtarget);
17409-
NarrowOp =
17410-
convertToScalableVector(NarrowContainerVT, NarrowOp, DAG, Subtarget);
17411-
ContainerVT = getContainerForFixedLengthVector(DAG, VT, Subtarget);
17412-
}
1741317404
Passthru = DAG.getUNDEF(VT);
17414-
std::tie(Mask, VL) = getDefaultVLOps(VT, ContainerVT, DL, DAG, Subtarget);
17405+
std::tie(Mask, VL) = getDefaultScalableVLOps(VT, DL, DAG, Subtarget);
1741517406
break;
1741617407
case RISCVISD::SHL_VL:
1741717408
Passthru = N->getOperand(2);
@@ -17421,13 +17412,10 @@ static SDValue combineSHL(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
1742117412
default:
1742217413
llvm_unreachable("Expected SHL");
1742317414
}
17424-
SDValue Mul =
17425-
DAG.getNode(Opcode, DL, ContainerVT, NarrowOp,
17426-
DAG.getConstant(1ULL << ShAmtInt, SDLoc(RHS), ContainerVT),
17427-
Passthru, Mask, VL);
17428-
if (VT.isFixedLengthVector())
17429-
return convertFromScalableVector(VT, Mul, DAG, Subtarget);
17430-
return Mul;
17415+
return DAG.getNode(
17416+
Opcode, DL, VT, NarrowOp,
17417+
DAG.getConstant(1ULL << ShAmtInt, SDLoc(RHS), NarrowVT),
17418+
Passthru, Mask, VL);
1743117419
}
1743217420

1743317421
SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,

0 commit comments

Comments
 (0)