[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:48 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()) {
+ if (vputils::isSingleScalar(Def) || vputils::onlyFirstLaneUsed(Def))
+ continue;
+
+ if (VPBB->getParent() != Plan.getVectorLoopRegion())
----------------
artagnon wrote:
```suggestion
if (VPBB->getParent() != LoopRegion)
```
Can this ever happen? I thought we were doing a shallow traversal?
https://github.com/llvm/llvm-project/pull/155670
More information about the llvm-commits
mailing list