[llvm] [VPlan] Use wide IV if scalar lanes > 0 are used with scalable vectors. (PR #169796)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 1 01:55:44 PST 2025


================
@@ -794,12 +794,17 @@ static void legalizeAndOptimizeInductions(VPlan &Plan) {
         WideIV->getDebugLoc(), Builder);
 
     // Update scalar users of IV to use Step instead.
-    if (!HasOnlyVectorVFs)
+    if (!HasOnlyVectorVFs) {
----------------
david-arm wrote:

Is it worth adding an assert here that the plan doesn't have a scalable VF? i.e.

```
  if (!HasOnlyVectorVFs) {
    assert(!Plan.hasScalableVF() && ...);
...
```

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


More information about the llvm-commits mailing list