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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 06:41:42 PDT 2024


================
@@ -4780,7 +4780,10 @@ 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 = A.Width.isScalable() && !B.Width.isScalable();
+  if (TTI.preferFixedOverScalableIfEqualCost())
----------------
david-arm wrote:

Is it worth rewriting this to be something like:

```
  bool PreferScalable = !TTI.preferFixedOverScalableIfEqualCost() &&
      A.Width.isScalable() && !B.Width.isScalable();
```

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


More information about the llvm-commits mailing list