[llvm] [VPlan] Make CanIV part of region. (PR #144803)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 25 14:29:46 PDT 2025


================
@@ -9742,19 +9739,18 @@ preparePlanForEpilogueVectorLoop(VPlan &Plan, Loop *L,
   Header->setName("vec.epilog.vector.body");
 
   DenseMap<Value *, Value *> ToFrozen;
-  // Ensure that the start values for all header phi recipes are updated before
-  // vectorizing the epilogue loop.
-  for (VPRecipeBase &R : Header->phis()) {
-    if (auto *IV = dyn_cast<VPCanonicalIVPHIRecipe>(&R)) {
-      // When vectorizing the epilogue loop, the canonical induction start
-      // value needs to be changed from zero to the value after the main
-      // vector loop. Find the resume value created during execution of the main
-      // VPlan.
-      // FIXME: Improve modeling for canonical IV start values in the epilogue
-      // loop.
-      using namespace llvm::PatternMatch;
-      Type *IdxTy = IV->getScalarType();
-      PHINode *EPResumeVal = find_singleton<PHINode>(
+
+  auto *IV = Plan.getCanonicalIV();
+  // When vectorizing the epilogue loop, the canonical induction start
+  // value needs to be changed from zero to the value after the main
+  // vector loop. Find the resume value created during execution of the main
+  // VPlan.
+  // FIXME: Improve modeling for canonical IV start values in the epilogue
+  // loop.
----------------
fhahn wrote:

Updated, thanks

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


More information about the llvm-commits mailing list