[llvm] 086666d - [VPlan] Improve code using drop_begin, append_range (NFC) (#163934)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Oct 20 01:07:22 PDT 2025
    
    
  
Author: Ramkumar Ramachandra
Date: 2025-10-20T09:07:18+01:00
New Revision: 086666de834a72eadc302a18e2bc51ba2bce1937
URL: https://github.com/llvm/llvm-project/commit/086666de834a72eadc302a18e2bc51ba2bce1937
DIFF: https://github.com/llvm/llvm-project/commit/086666de834a72eadc302a18e2bc51ba2bce1937.diff
LOG: [VPlan] Improve code using drop_begin, append_range (NFC) (#163934)
Added: 
    
Modified: 
    llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index fa1fdaf7b5ce0..64bbe630e3172 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -106,7 +106,7 @@ bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
             return false;
           NewRecipe = new VPWidenIntrinsicRecipe(
               *CI, getVectorIntrinsicIDForCall(CI, &TLI),
-              {Ingredient.op_begin(), Ingredient.op_end() - 1}, CI->getType(),
+              drop_end(Ingredient.operands()), CI->getType(),
               CI->getDebugLoc());
         } else if (SelectInst *SI = dyn_cast<SelectInst>(Inst)) {
           NewRecipe = new VPWidenSelectRecipe(*SI, Ingredient.operands());
@@ -356,8 +356,7 @@ static VPRegionBlock *createReplicateRegion(VPReplicateRecipe *PredRecipe,
   // Replace predicated replicate recipe with a replicate recipe without a
   // mask but in the replicate region.
   auto *RecipeWithoutMask = new VPReplicateRecipe(
-      PredRecipe->getUnderlyingInstr(),
-      make_range(PredRecipe->op_begin(), std::prev(PredRecipe->op_end())),
+      PredRecipe->getUnderlyingInstr(), drop_end(PredRecipe->operands()),
       PredRecipe->isSingleScalar(), nullptr /*Mask*/, *PredRecipe);
   auto *Pred =
       Plan.createVPBasicBlock(Twine(RegionName) + ".if", RecipeWithoutMask);
@@ -939,7 +938,7 @@ static void recursivelyDeleteDeadRecipes(VPValue *V) {
       continue;
     if (!isDeadRecipe(*R))
       continue;
-    WorkList.append(R->op_begin(), R->op_end());
+    append_range(WorkList, R->operands());
     R->eraseFromParent();
   }
 }
        
    
    
More information about the llvm-commits
mailing list