[llvm] [VPlan] Replicate VPScalarIVStepsRecipe by VF outside replicate regions. (PR #170053)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 03:32:15 PST 2026


================
@@ -591,12 +589,31 @@ cloneForLane(VPlan &Plan, VPBuilder &Builder, Type *IdxTy,
                                 /*IsSingleScalar=*/true, /*Mask=*/nullptr,
                                 *RepR, *RepR, RepR->getDebugLoc());
   } else {
-    assert(isa<VPInstruction>(DefR) &&
-           "DefR must be a VPReplicateRecipe or VPInstruction");
+    assert((isa<VPInstruction, VPScalarIVStepsRecipe>(DefR)) &&
+           "DefR must be a VPReplicateRecipe, VPInstruction or "
+           "VPScalarIVStepsRecipe");
     New = DefR->clone();
     for (const auto &[Idx, Op] : enumerate(NewOps)) {
       New->setOperand(Idx, Op);
     }
+    if (auto *Steps = dyn_cast<VPScalarIVStepsRecipe>(New)) {
----------------
ayalz wrote:

Ok, fair enough, just seems self-contained / outlineable.

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


More information about the llvm-commits mailing list