[llvm] [VPlan] Compute interleave count for VPlan. (PR #149702)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 5 02:52:33 PDT 2025
================
@@ -486,6 +486,13 @@ class LoopVectorizationPlanner {
/// all profitable VFs in ProfitableVFs.
VectorizationFactor computeBestVF();
+ /// \return The desired interleave count.
+ /// If interleave count has been specified by metadata it will be returned.
+ /// Otherwise, the interleave count is computed and returned. VF and LoopCost
+ /// are the selected vectorization factor and the cost of the selected VF.
+ unsigned selectInterleaveCount(VPlan &Plan, ElementCount VF,
+ InstructionCost LoopCost);
+
----------------
ayalz wrote:
Should selecting IC/UF be (more) aligned with selecting VF above, as in `computeBestUF()` rather than `selectInterleaveCount()`, and
```/// Compute and return the most profitable interleave count - unroll factor.```?
Follow-up thought: different UF's typically do not lead to different decisions (contrary to different VF's), so it may not be worth cloning the VPlan having best VF to check and optimized for different UF's (or UF ranges) and then select the best (as done for VF ranges). But the effects of `optimizeForVFAndUF()` and potential redundancies surfaced by `unrollByUF()` might be important to consider when selecting best UF.
https://github.com/llvm/llvm-project/pull/149702
More information about the llvm-commits
mailing list