[llvm-branch-commits] [llvm] [VPlan] Scalarize to first-lane-only directly on VPlan (PR #184267)

Ramkumar Ramachandra via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Mar 3 09:53:02 PST 2026


================
@@ -6395,3 +6395,68 @@ void VPlanTransforms::makeMemOpWideningDecisions(
                              return ReplaceWith(VPI, Recipe);
                            });
 }
+
+void VPlanTransforms::makeScalarizationDecisions(
+    VPlan &Plan, VFRange &Range, VPRecipeBuilder &RecipeBuilder) {
+  if (LoopVectorizationPlanner::getDecisionAndClampRange(
+          [&](ElementCount VF) { return VF.isScalar(); }, Range))
----------------
artagnon wrote:

Ah, I thought it would work, as the object is the argument (VF)? Can you try a variation with std::bind or bind_{front,back} possibly with std::placeholders, just as an academic exercise?

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


More information about the llvm-branch-commits mailing list