[llvm] [VPlan] Add narrowToSingleScalarRecipe transform. (PR #139150)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 16 14:52:24 PDT 2025


================
@@ -1086,6 +1086,40 @@ void VPlanTransforms::simplifyRecipes(VPlan &Plan, Type &CanonicalIVTy) {
   }
 }
 
+static void convertToUniformRecipes(VPlan &Plan) {
+  if (Plan.hasScalarVFOnly())
+    return;
+
+  for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
+           vp_depth_first_shallow(Plan.getVectorLoopRegion()->getEntry()))) {
----------------
ayalz wrote:

Worth a comment. This also prevents narrowing recipes in nested loop regions.

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


More information about the llvm-commits mailing list