Skip to content

Commit 06d3ee9

Browse files
committed
[RISCV] Fix wrong operand being used for VL in shift combine
At some point a merge operand was added to the binary vl ops, so this combine was using the mask for the VL. This causes a crash when trying to select the vmv_v_x_vl, which showed up locally when messing about with selectVSplat, but thankfully in ToT the vmv_v_x_vl gets pattern matched away into the .vx and .vi operands every time, so there's no noticeable change. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D158634
1 parent dc8e46c commit 06d3ee9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13730,7 +13730,7 @@ SDValue RISCVTargetLowering::PerformDAGCombine(SDNode *N,
1373013730
if (ShAmt.getOpcode() == RISCVISD::SPLAT_VECTOR_SPLIT_I64_VL) {
1373113731
// We don't need the upper 32 bits of a 64-bit element for a shift amount.
1373213732
SDLoc DL(N);
13733-
SDValue VL = N->getOperand(3);
13733+
SDValue VL = N->getOperand(4);
1373413734
EVT VT = N->getValueType(0);
1373513735
ShAmt = DAG.getNode(RISCVISD::VMV_V_X_VL, DL, VT, DAG.getUNDEF(VT),
1373613736
ShAmt.getOperand(1), VL);

0 commit comments

Comments
 (0)