[llvm] 3068132 - [LV] Use bind_front in tryToOptimizeInductionTruncate (NFC) (#189763)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 00:19:54 PDT 2026


Author: Ramkumar Ramachandra
Date: 2026-04-01T08:19:49+01:00
New Revision: 3068132e32c11839c2626347d5288f16d6623bea

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

LOG: [LV] Use bind_front in tryToOptimizeInductionTruncate (NFC) (#189763)

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 ac94d0dbcc4cd..3f77d02e3ed0a 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7786,15 +7786,10 @@ VPRecipeBuilder::tryToOptimizeInductionTruncate(VPInstruction *VPI,
 
   // Determine whether \p K is a truncation based on an induction variable that
   // can be optimized.
-  auto IsOptimizableIVTruncate =
-      [&](Instruction *K) -> std::function<bool(ElementCount)> {
-    return [=](ElementCount VF) -> bool {
-      return CM.isOptimizableIVTruncate(K, VF);
-    };
-  };
-
   if (!LoopVectorizationPlanner::getDecisionAndClampRange(
-          IsOptimizableIVTruncate(I), Range))
+          bind_front(&LoopVectorizationCostModel::isOptimizableIVTruncate, CM,
+                     I),
+          Range))
     return nullptr;
 
   auto *WidenIV = cast<VPWidenIntOrFpInductionRecipe>(


        


More information about the llvm-commits mailing list