[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
================
@@ -9207,7 +9205,8 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
if (!PhiR)
continue;
- const RecurrenceDescriptor &RdxDesc = PhiR->getRecurrenceDescriptor();
+ const RecurrenceDescriptor &RdxDesc = Legal->getRecurrenceDescriptor(
+ cast<PHINode>(PhiR->getUnderlyingInstr()));
----------------
ayalz wrote:
```suggestion
RecurKind RecurrenceKind = PhiR->getRecurrenceKind();
const RecurrenceDescriptor &RdxDesc = Legal->getRecurrenceDescriptor(
cast<PHINode>(PhiR->getUnderlyingInstr()));
```
and replace `RdxDesc.getRecurrenceKind()` below with `RecurrenceKind`?
Getting rid of RdxDesc here is more difficult: in addition to capturing RdxDesc's FMF in PhiR, code below also uses RdxDesc to retrieve sentinel value, recurrence type, isSigned, Loop Exit Instr, ... ?
https://github.com/llvm/llvm-project/pull/142322
More information about the llvm-commits
mailing list