[llvm] [AArch64] Lower partial add reduction to udot or svdot (PR #101010)

Sam Tebbs via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 03:05:01 PDT 2024


================
@@ -21237,6 +21279,83 @@ static SDValue performIntrinsicCombine(SDNode *N,
   switch (IID) {
   default:
     break;
+  case Intrinsic::experimental_vector_partial_reduce_add: {
+    SDLoc DL(N);
+
+    bool IsValidDotProduct = true;
+
+    auto NarrowOp = N->getOperand(1);
+    auto MulOp = N->getOperand(2);
+    if (MulOp->getOpcode() != ISD::MUL)
+      IsValidDotProduct = false;
+
+    auto ExtA = MulOp->getOperand(0);
+    auto ExtB = MulOp->getOperand(1);
+    bool IsSExt = ExtA->getOpcode() == ISD::SIGN_EXTEND;
+    bool IsZExt = ExtA->getOpcode() == ISD::ZERO_EXTEND;
+    if (ExtA->getOpcode() != ExtB->getOpcode() || (!IsSExt && !IsZExt))
----------------
SamTebbs33 wrote:

Can the types be altered between `shouldExpandPartialReductionIntrinsic` being called and lowering happening? If not then I'd expect them to be fine here even if the nodes themselves have changed.

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


More information about the llvm-commits mailing list