[llvm] [VPlan] Add VPInstruction to unpack vector values to scalars. (PR #155670)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 11 12:33:37 PDT 2025
================
@@ -3789,6 +3796,48 @@ void VPlanTransforms::materializeBuildVectors(VPlan &Plan) {
});
}
}
+
+ // Create explicit VPInstructions to convert vectors to scalars.
+ for (VPBasicBlock *VPBB : VPBBsInsideLoopRegion) {
+ for (VPRecipeBase &R : make_early_inc_range(*VPBB)) {
+ if (isa<VPReplicateRecipe, VPInstruction, VPScalarIVStepsRecipe,
+ VPDerivedIVRecipe, VPCanonicalIVPHIRecipe>(&R))
+ continue;
+ for (VPValue *Def : R.definedValues()) {
+ // Skip recipes that are single-scalar or only have their first lane
+ // used.
+ // TODO: The Defs skipped here may or may not be vector values.
+ // Introduce Unpacks, and remove them later, if they are guaranteed to
+ // produce scalar values.
----------------
fhahn wrote:
Moved and adjusted, thanks
https://github.com/llvm/llvm-project/pull/155670
More information about the llvm-commits
mailing list