[llvm] [VPlan] Impl VPlan-based pattern match for ExtendedRed and MulAccRed (PR #113903)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 22 02:13:30 PDT 2025


================
@@ -2341,6 +2373,28 @@ class VPReductionRecipe : public VPRecipeWithIRFlags {
     setUnderlyingValue(I);
   }
 
+  /// For VPExtendedReductionRecipe.
+  /// Note that IsNonNeg flag and the debug location are from the extend.
+  VPReductionRecipe(const unsigned char SC, const RecurKind RdxKind,
+                    ArrayRef<VPValue *> Operands, VPValue *CondOp,
+                    bool IsOrdered, NonNegFlagsTy NonNeg, DebugLoc DL)
+      : VPRecipeWithIRFlags(SC, Operands, NonNeg, DL), RdxKind(RdxKind),
+        IsOrdered(IsOrdered), IsConditional(CondOp) {
+    if (CondOp)
+      addOperand(CondOp);
+  }
+
+  /// For VPMulAccumulateReductionRecipe.
+  /// Note that the NUW/NSW and DL are from the Mul.
----------------
fhahn wrote:

```suggestion
  /// Note that the NUW/NSW flags and the debug location are from the Mul.
```

(for consistency with comment above)

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


More information about the llvm-commits mailing list