[llvm-branch-commits] [llvm] Patch 2: [LV][NFCI] Parameterize IAI instance for the Planner (PR #202819)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jun 9 17:55:18 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-vectorizers
Author: Hassnaa Hamdi (hassnaaHamdi)
<details>
<summary>Changes</summary>
Following Patch 1, this removes `InterleavedAccessInfo &IAI` as a stored member of `LoopVectorizationPlanner` and replaces all uses of `IAI` inside the planner with `CM.InterleaveInf`, which holds the same object.
The constructor no longer takes `IAI` as a separate argument.
This is a pure cleanup enabled by Patch 1 — since `CM` is now a parameter, its `InterleaveInfo` field is already accessible wherever needed.
---
Full diff: https://github.com/llvm/llvm-project/pull/202819.diff
2 Files Affected:
- (modified) llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h (+3-7)
- (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+4-3)
``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index 92c2f5b6950fa..8164bc5b620c5 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -806,9 +806,6 @@ class LoopVectorizationPlanner {
/// VF selection state independent of cost-modeling decisions.
VFSelectionContext &Config;
- /// The interleaved access analysis.
- InterleavedAccessInfo &IAI;
-
PredicatedScalarEvolution &PSE;
const LoopVectorizeHints &Hints;
@@ -844,11 +841,10 @@ class LoopVectorizationPlanner {
LoopVectorizationPlanner(
Loop *L, LoopInfo *LI, DominatorTree *DT, const TargetLibraryInfo *TLI,
const TargetTransformInfo &TTI, LoopVectorizationLegality *Legal,
- VFSelectionContext &Config, InterleavedAccessInfo &IAI,
- PredicatedScalarEvolution &PSE, const LoopVectorizeHints &Hints,
- OptimizationRemarkEmitter *ORE)
+ VFSelectionContext &Config, PredicatedScalarEvolution &PSE,
+ const LoopVectorizeHints &Hints, OptimizationRemarkEmitter *ORE)
: OrigLoop(L), LI(LI), DT(DT), TLI(TLI), TTI(TTI), Legal(Legal),
- Config(Config), IAI(IAI), PSE(PSE), Hints(Hints), ORE(ORE) {}
+ Config(Config), PSE(PSE), Hints(Hints), ORE(ORE) {}
/// Build VPlans for the specified \p UserVF and \p UserIC if they are
/// non-zero or all applicable candidate VFs otherwise. If vectorization and
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index e815009d992ad..e11d9054b6c8f 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6683,7 +6683,8 @@ LoopVectorizationPlanner::tryToBuildVPlan(VPlanPtr Plan, VFRange &Range,
// Range, add it to the set of groups to be later applied to the VPlan and add
// placeholders for its members' Recipes which we'll be replacing with a
// single VPInterleaveRecipe.
- for (InterleaveGroup<Instruction> *IG : IAI.getInterleaveGroups()) {
+ for (InterleaveGroup<Instruction> *IG :
+ CM.InterleaveInfo.getInterleaveGroups()) {
auto ApplyIG = [IG, &CM](ElementCount VF) -> bool {
bool Result = (VF.isVector() && // Query is illegal for VF == 1
CM.getWideningDecision(IG->getInsertPos(), VF) ==
@@ -8008,8 +8009,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
LoopVectorizationCostModel CM(SEL, L, PSE, LI, &LVL, *TTI, TLI, AC, ORE,
GetBFI, F, &Hints, IAI, Config);
// Use the planner for vectorization.
- LoopVectorizationPlanner LVP(L, LI, DT, TLI, *TTI, &LVL, Config, IAI, PSE,
- Hints, ORE);
+ LoopVectorizationPlanner LVP(L, LI, DT, TLI, *TTI, &LVL, Config, PSE, Hints,
+ ORE);
EpilogueLowering EpilogueTailLoweringStatus =
getEpilogueTailLowering(CM, L, ORE);
``````````
</details>
https://github.com/llvm/llvm-project/pull/202819
More information about the llvm-branch-commits
mailing list