[llvm] [NVPTX] Use correct `mul.wide` operand type when matching on `shl` in `combineMulWide` (PR #168986)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 21 10:59:31 PST 2025


================
@@ -5695,8 +5695,8 @@ static SDValue combineMulWide(SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
   SDValue RHS = Op.getOperand(1);
   if (Op.getOpcode() == ISD::SHL) {
     const auto ShiftAmt = Op.getConstantOperandVal(1);
-    const auto MulVal = APInt(ToVT.getSizeInBits(), 1) << ShiftAmt;
-    RHS = DCI.DAG.getConstant(MulVal, DL, ToVT);
+    const auto MulVal = APInt(FromVT.getSizeInBits(), 1) << ShiftAmt;
+    RHS = DCI.DAG.getConstant(MulVal, DL, FromVT);
----------------
Artem-B wrote:

It would be great to add a test that would catch such a mismatch.

https://github.com/llvm/llvm-project/pull/168986


More information about the llvm-commits mailing list