[llvm] f1451e9 - [LV] Improve code using drop_{begin, end} (NFC) (#147504)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 05:42:14 PDT 2025


Author: Ramkumar Ramachandra
Date: 2025-07-08T13:42:10+01:00
New Revision: f1451e9f0706316af8e0a537870407284fb920c8

URL: https://github.com/llvm/llvm-project/commit/f1451e9f0706316af8e0a537870407284fb920c8
DIFF: https://github.com/llvm/llvm-project/commit/f1451e9f0706316af8e0a537870407284fb920c8.diff

LOG: [LV] Improve code using drop_{begin,end} (NFC) (#147504)

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index e7bae17dd2ceb..6bd6ba2d77bbb 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -6555,7 +6555,7 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
   }
 
   for (const auto &[_, Ops] : DeadInvariantStoreOps)
-    llvm::append_range(DeadOps, ArrayRef(Ops).drop_back());
+    llvm::append_range(DeadOps, drop_end(Ops));
 
   // Mark ops that would be trivially dead and are only used by ignored
   // instructions as free.
@@ -9097,7 +9097,7 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
     // get folded to their non-phi operand, as the reduction recipe handles the
     // condition directly.
     VPSingleDefRecipe *PreviousLink = PhiR; // Aka Worklist[0].
-    for (VPSingleDefRecipe *CurrentLink : Worklist.getArrayRef().drop_front()) {
+    for (VPSingleDefRecipe *CurrentLink : drop_begin(Worklist)) {
       if (auto *Blend = dyn_cast<VPBlendRecipe>(CurrentLink)) {
         assert(Blend->getNumIncomingValues() == 2 &&
                "Blend must have 2 incoming values");


        


More information about the llvm-commits mailing list