[llvm] [VPlan] Add VPInstruction to unpack vector values to scalars. (PR #155670)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 20 14:48:47 PDT 2025


================
@@ -3755,6 +3764,48 @@ void VPlanTransforms::materializeBuildVectors(VPlan &Plan) {
           });
     }
   }
+
+  // Create explicit VPInstructions to convert vectors to scalars.
+  for (VPBasicBlock *VPBB :
+       concat<VPBasicBlock *>(VPBBsOutsideLoopRegion, VPBBsInsideLoopRegion)) {
+    for (VPRecipeBase &R : make_early_inc_range(*VPBB)) {
+      if (isa<VPReplicateRecipe, VPInstruction, VPScalarIVStepsRecipe>(&R))
+        continue;
+      for (VPValue *Def : R.definedValues()) {
----------------
artagnon wrote:

Aren't replicate, instruction, and scalar-iv-steps single-def?

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


More information about the llvm-commits mailing list