[llvm] [VPlan] Replace RdxDesc with RecurKind in VPReductionPHIRecipe (NFC). (PR #142322)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 6 09:34:32 PDT 2025


================
@@ -301,6 +301,11 @@ class LoopVectorizationLegality {
   /// Returns the reduction variables found in the loop.
   const ReductionList &getReductionVars() const { return Reductions; }
 
+  RecurrenceDescriptor getRecurrenceDescriptor(PHINode *PN) const {
+    assert(Reductions.contains(PN) && "no recurrence descriptor for phi");
+    return Reductions.lookup(PN);
+  }
+
----------------
ayalz wrote:

Independent: can update below
`bool isReductionVariable(PHINode *PN) const { return Reductions.count(PN); }`
to
`bool isReductionVariable(PHINode *PN) const { return Reductions.contains(PN); }`

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


More information about the llvm-commits mailing list