================
@@ -18510,6 +18551,30 @@ static SDValue combineAddMulh(SDNode *N, SelectionDAG
&DAG,
return DAG.getNode(RISCVISD::MULHSU, DL, VT, X, Mulh.getOperand(1));
}
+// Fold an add of a multiply-parts product into the accumulating form.
+static SDValue combineAddMulParts(SDNode *N, SelectionDAG &DAG,
+ const RISCVSubtarget &Subtarget) {
+ if (!Subtarget.hasStdExtP())
+ return SDValue();
+
+ for (unsigned I = 0; I != 2; ++I) {
+ SDValue Mul = N->getOperand(I);
+ if (Mul.getOpcode() != ISD::INTRINSIC_WO_CHAIN || !Mul.hasOneUse())
+ continue;
+ Intrinsic::ID AccId =
+ getRVPMulPartsAccIntrinsic(Mul.getConstantOperandVal(0));
+ if (AccId == Intrinsic::not_intrinsic)
+ continue;
+
+ SDLoc DL(N);
+ return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, DL, N->getValueType(0),
+ DAG.getTargetConstant(AccId, DL, MVT::i32),
----------------
sihuan wrote:
Fixed.
https://github.com/llvm/llvm-project/pull/222748
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits