[llvm] [LV] -scalable-vectorization=preferred should not override UserVF=1 (PR #226948)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 03:35:26 PDT 2026


================
@@ -0,0 +1,37 @@
+; RUN: opt -force-target-supports-scalable-vectors -scalable-vectorization=preferred -passes=loop-vectorize -S %s | FileCheck %s
+;
+; Clang lowers "#pragma clang loop vectorize(disable) interleave_count(1)" to
+; width 1 and interleave count 1.
----------------
gbossu wrote:

This is something I found when investigating the compilation error that https://github.com/llvm/llvm-project/pull/214471 introduced in LNT. I wanted to understand why some loops were now vectorised with `VF=vscale x 1`.

It turns out that the "scalar" loops with `vectorize(disable)` pragmas were actually vectorised with `VF=vscale x 1` because of the `scalable-vectorization=preferred` flag. I don't think this flag should override `UserVF=1` and turn it into a scalable VF.

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


More information about the llvm-commits mailing list