[llvm] [LoopVectorize][AArch64][SVE] Generate wide active lane masks (PR #81140)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 02:55:04 PDT 2024


================
@@ -3383,6 +3383,15 @@ unsigned AArch64TTIImpl::getMaxInterleaveFactor(ElementCount VF) {
   return ST->getMaxInterleaveFactor();
 }
 
+ElementCount AArch64TTIImpl::getMaxPredicateLength(ElementCount VF) const {
+  // Do not create masks bigger than `<vscale x 16 x i1>`.
+  unsigned N = ST->hasSVE() ? 16 : 0;
+  // Do not create masks that are more than twice the VF.
+  N = std::min(N, 2 * VF.getKnownMinValue());
+  return VF.isScalable() ? ElementCount::getScalable(N)
----------------
fhahn wrote:

Can the profitability be determined in terms of cost of active.lane.mask + different predicate vectors?

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


More information about the llvm-commits mailing list