[llvm] [LV, VP]VP intrinsics support for the Loop Vectorizer + adding new tail-folding mode using EVL. (PR #76172)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 14:34:53 PST 2024


================
@@ -8599,6 +8655,8 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
         VPlanTransforms::truncateToMinimalBitwidths(
             *Plan, CM.getMinimalBitwidths(), PSE.getSE()->getContext());
       VPlanTransforms::optimize(*Plan, *PSE.getSE());
+      if (CM.useVPIWithVPEVLVectorization())
+        VPlanTransforms::addExplicitVectorLength(*Plan);
----------------
ayalz wrote:

CM information is (still) needed to guard addExplicitVectorLength(), so it cannot (yet) be part of VPlanTransforms::optimize(), similar to addActiveLaneMask(). Is there a reason why addExplicitVectorLength() is invoked **after** optimize()? Could it be invoked before, at the end of tryToBuildVPlanWithVPRecipes() - if Style is EVL, alongside / as an alternative of invoking addActiveLaneMask() - if useActiveLaneMask(Style)? The two should conceptually appear together, either before or after optimize().

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


More information about the llvm-commits mailing list