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

Andrei Elovikov via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 08:25:01 PDT 2026


================
@@ -6541,3 +6541,60 @@ void VPlanTransforms::makeMemOpWideningDecisions(
     ReplaceWith(Recipe);
   }
 }
+
+void VPlanTransforms::makeScalarizationDecisions(VPlan &Plan, VFRange &Range) {
+  if (LoopVectorizationPlanner::getDecisionAndClampRange(
+          [&](ElementCount VF) { return VF.isScalar(); }, Range))
----------------
eas wrote:

* That would be a function change from the current behavior
* My understanding is we try to keep scalar VPlan unmodified for costing, so we do need to clamp range here.

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


More information about the llvm-commits mailing list