[llvm] [AArch64][SVE] Add dot product lowering for PARTIAL_REDUCE_MLA node (PR #130933)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 01:46:17 PDT 2025


================
@@ -1585,6 +1585,26 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
       setOperationAction(ISD::MSTORE, VT, Custom);
     }
 
+    if (EnablePartialReduceNodes) {
+      for (MVT VT : MVT::integer_scalable_vector_valuetypes()) {
+        for (MVT InnerVT : MVT::integer_scalable_vector_valuetypes()) {
+          // 1. Set all combinations where a type is illegal to "Legal"
+          // - These will be legalized to a legal type pair
+          // - Avoid expanding them too early (or preventing folds)
+          if (!isTypeLegal(VT) || !isTypeLegal(InnerVT)) {
+            setPartialReduceMLAAction(VT, InnerVT, Legal);
+            continue;
+          }
+          //  2. Set all legal combinations to "Expand"
+          // - Not all of these can be lowered (via a Legal or Custom lowering).
+          setPartialReduceMLAAction(VT, InnerVT, Expand);
----------------
sdesmalen-arm wrote:

We might be able to use the information from this table to guide TargetTransformInfo on whether the operation is legal or not, and thus whether or not to create the node. So if this table is accurate, we can reuse that information in TTI.

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


More information about the llvm-commits mailing list