[llvm] [LV][EVL] Support in-loop reduction using tail folding with EVL. (PR #90184)

Kolya Panchenko via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 11:02:13 PDT 2024


================
@@ -2144,16 +2151,67 @@ class VPReductionRecipe : public VPSingleDefRecipe {
              VPSlotTracker &SlotTracker) const override;
 #endif
 
+  /// Return the recurrence decriptor for the in-loop reduction.
+  const RecurrenceDescriptor &getRecurrenceDescriptor() const {
+    return RdxDesc;
+  }
+  /// Return true if the in-loop reduction is ordered.
+  bool isOrdered() const { return IsOrdered; };
   /// The VPValue of the scalar Chain being accumulated.
   VPValue *getChainOp() const { return getOperand(0); }
   /// The VPValue of the vector value to be reduced.
   VPValue *getVecOp() const { return getOperand(1); }
   /// The VPValue of the condition for the block.
-  VPValue *getCondOp() const {
+  virtual VPValue *getCondOp() const {
----------------
nikolaypanchenko wrote:

It's better to have convention that EVL is always the last operand.

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


More information about the llvm-commits mailing list