[llvm] [VPlan] Create AVL as a phi from TC -> 0 with EVL tail folding (PR #151481)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 07:50:31 PDT 2025


================
@@ -2350,9 +2350,12 @@ bool VPlanTransforms::tryAddExplicitVectorLength(
   auto *EVLPhi = new VPEVLBasedIVPHIRecipe(StartV, DebugLoc());
   EVLPhi->insertAfter(CanonicalIVPHI);
   VPBuilder Builder(Header, Header->getFirstNonPhi());
-  // Compute original TC - IV as the AVL (application vector length).
-  VPValue *AVL = Builder.createNaryOp(
-      Instruction::Sub, {Plan.getTripCount(), EVLPhi}, DebugLoc(), "avl");
+  // Create the AVL (application vector length), starting from TC -> 0 in steps
----------------
fhahn wrote:

The comment for `tryAddExplicitVectorLength` still needs updating I think, as it has the old style of AVL

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


More information about the llvm-commits mailing list