[llvm] [RISCV] Extend zvqdot matching to handle reduction trees (PR #138965)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 07:24:25 PDT 2025


================
@@ -18131,6 +18131,29 @@ static MVT getQDOTXResultType(MVT OpVT) {
   return MVT::getVectorVT(MVT::i32, OpEC.divideCoefficientBy(4));
 }
 
+/// Given fixed length vectors A and B with equal element types, but possibly
+/// different number of elements, return A + B where either A or B is zero
+/// padded to the larger number of elements.
+static SDValue getZeroPaddedAdd(const SDLoc &DL, SDValue A, SDValue B,
+                                SelectionDAG &DAG) {
+  // NOTE: Manually doing the extract/add/insert scheme produces
+  // significantly better coegen than the naive pad with zeros
----------------
lukel97 wrote:

```suggestion
  // significantly better codegen than the naive pad with zeros
```

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


More information about the llvm-commits mailing list