[llvm] [VPlan] Run narrowInterleaveGroups during general VPlan optimizations. (PR #149706)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 11 08:27:38 PDT 2025


================
@@ -333,14 +333,19 @@ struct VPlanTransforms {
   static DenseMap<const SCEV *, Value *> expandSCEVs(VPlan &Plan,
                                                      ScalarEvolution &SE);
 
-  /// Try to convert a plan with interleave groups with VF elements to a plan
-  /// with the interleave groups replaced by wide loads and stores processing VF
-  /// elements, if all transformed interleave groups access the full vector
-  /// width (checked via \o VectorRegWidth). This effectively is a very simple
-  /// form of loop-aware SLP, where we use interleave groups to identify
-  /// candidates.
-  static void narrowInterleaveGroups(VPlan &Plan, ElementCount VF,
-                                     unsigned VectorRegWidth);
+  /// Try to find a single VF among \p Plan's VFs for which all interleave
+  /// groups (with VF elements) can be replaced by wide loads ans tores
+  /// processing VF elements, if all transformed interleave groups access the
+  /// full vector width (checked via \o VectorRegWidth). If the transformation
+  /// can be applied, the original \p Plan will be split in 2, if is has
----------------
david-arm wrote:

This is a bit difficult to follow. Do you mean something like

```
  /// can be applied, the original \p Plan will be split in 2:
  ///   1. The original Plan with the single VF containing the optimised recipes using wide loads instead of interleave groups.
  ///   2. A new clone which contains all VFs of Plan except the optimised VF.
```

It's unclear what `VFToOptimize` is because it's not passed as a parameter to the function.

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


More information about the llvm-commits mailing list