[llvm] [LoopVectorizer] Add a -force-vscale-for-tuning override option. (PR #156916)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 08:56:39 PDT 2025


================
@@ -1473,6 +1477,11 @@ class LoopVectorizationCostModel {
   /// vscale_range.min == vscale_range.max then return vscale_range.max, else
   /// return the value returned by the corresponding TTI method.
   void initializeVScaleForTuning() {
+    if (VScaleForTuningOpt.getNumOccurrences()) {
+      VScaleForTuning = VScaleForTuningOpt;
+      return;
+    }
----------------
fhahn wrote:

Is the purpose of the option to deliberately override the function attribute?


Does this have to be LV specific? Could this be handled in `getVScaleForTuning`?

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


More information about the llvm-commits mailing list