[llvm] [LV][AArch64] Prefer Fixed over Scalable if cost-model is equal (Neoverse V2) (PR #95819)

Dhruv Chawla via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 02:04:01 PDT 2024


================
@@ -4780,7 +4780,12 @@ bool LoopVectorizationPlanner::isMoreProfitable(
   // Assume vscale may be larger than 1 (or the value being tuned for),
   // so that scalable vectorization is slightly favorable over fixed-width
   // vectorization.
-  bool PreferScalable = A.Width.isScalable() && !B.Width.isScalable();
+  bool PreferScalable;
+  if (!TTI.preferFixedOverScalableIfEqualCost())
+    PreferScalable = !A.Width.isScalable() && B.Width.isScalable();
+  else
+    PreferScalable = A.Width.isScalable() && !B.Width.isScalable();
----------------
dc03-work wrote:

This can be moved into the initializer of the variable.

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


More information about the llvm-commits mailing list