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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 03:03:55 PDT 2025


================
@@ -2379,6 +2381,11 @@ bool VPlanTransforms::tryAddExplicitVectorLength(
       CanonicalIVIncrement->getDebugLoc(), "index.evl.next");
   EVLPhi->addOperand(NextEVLIV);
 
+  VPValue *NextAVL = Builder.createOverflowingOp(
+      Instruction::Sub, {AVLPhi, OpVPEVL}, {/*hasNUW=*/true, /*hasNSW=*/false},
+      DebugLoc(), "avl.next");
----------------
lukel97 wrote:

TIL about DebugLoc::getUnknown(). I don't see it used anywhere else in the loop vectorizer though, do we need to start using it here? 

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


More information about the llvm-commits mailing list