[llvm] [LV] Add cross-part load overlap heuristic for interleaving (PR #214500)

Sergey Shcherbinin via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 06:49:22 PDT 2026


================
@@ -894,6 +896,17 @@ class LoopVectorizationPlanner {
   /// A builder used to construct the current plan.
   VPBuilder Builder;
 
+  /// Cost-traversal results retained for eligible fixed-VF Plan/VF candidates
+  /// until IC selection decides whether cross-part CSE can affect interleaving.
+  ///
+  /// Each map contains the recipes visited while costing its exact candidate,
+  /// including zero entries for recipes whose direct cost was skipped. Recipes
+  /// outside that traversal are absent; cross-part analysis queries only its
+  /// supported widened-load recipes.
+  mutable DenseMap<std::pair<const VPlan *, ElementCount>,
+                   std::unique_ptr<VPRecipeCostMap>>
+      CrossPartCSERecipeCosts;
----------------
SergeyShch01 wrote:

Agreed. I removed this member and all related cache plumbing. Supported loads and their costs are now evaluated locally during selectInterleaveCount(), only when the ordinary heuristics would return IC=1. The planner no longer carries any cross-part state.

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


More information about the llvm-commits mailing list