[llvm] [LV][AArch64] Prefer epilogue with fixed-width over scalable VF in case of equal costs. (PR #155546)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 28 00:29:31 PDT 2025


================
@@ -6017,7 +6017,13 @@ static bool containsDecreasingPointers(Loop *TheLoop,
   return false;
 }
 
-bool AArch64TTIImpl::preferFixedOverScalableIfEqualCost() const {
+bool AArch64TTIImpl::preferFixedOverScalableIfEqualCost(bool IsEpilogue) const {
+  // For cases like post-LTO vectorization, when we eventually know the trip
+  // count, epilogue with fixed-width vectorization can be deleted if the trip
+  // count is less than the epilogue iterations. That's why we prefer
+  // fixed-width vectorization in epilogue in case of equal costs.
+  if (IsEpilogue)
----------------
fhahn wrote:

The reasoning above seems not CPU specific and should apply to all CPUs?

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


More information about the llvm-commits mailing list