[llvm] [VPlan] Model FOR resume value extraction in VPlan. (PR #93396)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 06:56:10 PDT 2024
================
@@ -855,6 +904,13 @@ bool VPlanTransforms::adjustFixedOrderRecurrences(VPlan &Plan,
{}, "vector.recur.extract.for.phi"));
RecurSplice->replaceUsesWithIf(
Result, [](VPUser &U, unsigned) { return isa<VPLiveOut>(&U); });
+ auto *Resume = MiddleBuilder.createNaryOp(
+ VPInstruction::ExtractFromEnd,
+ {FOR->getBackedgeValue(),
+ Plan.getOrAddLiveIn(ConstantInt::get(IntTy, 1))},
+ {}, "vector.recur.extract");
+ // Introduce VPUsers modeling the exit values.
----------------
ayalz wrote:
```suggestion
// Introduce VPUsers modeling the resume values.
```
-- thereby avoiding the need to mark them as having side-effects, as noted in the commit message? Other parts of the commit message also need updating.
Better keep the distinction between "next iteration" values used to continue the recurrence (in the subsequent vector or scalar iteration, potentially also epilog vector loop if/when enabled) and "last iteration" values used to feed users in the exit block, by referring to them as "resume" and "exit" values, respectively. Moreover as both feed similar VPLiveOuts dumped together.
https://github.com/llvm/llvm-project/pull/93396
More information about the llvm-commits
mailing list