[llvm] [AArch64][LoopVectorize] Use either fixed-width or scalable VF when tail-folding (PR #67543)

Matthew Devereau via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 07:28:58 PDT 2023


================
@@ -5142,7 +5142,9 @@ ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
     LLVM_DEBUG(dbgs() << "LV: Clamping the MaxVF to maximum power of two not "
                          "exceeding the constant trip count: "
                       << ClampedConstTripCount << "\n");
-    return ElementCount::getFixed(ClampedConstTripCount);
+    return ElementCount::get(
+        ClampedConstTripCount,
+        FoldTailByMasking ? MaxVectorElementCount.isScalable() : false);
----------------
MDevereau wrote:

I see, fair enough then. Given this change is in /llvm and not /clang I think its a bit of a shame to rely on the clang tests for this assertion though, but that's not really a big deal.

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


More information about the llvm-commits mailing list