[llvm] [VPlan] Implement interleaving as VPlan-to-VPlan transform. (PR #95842)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 11:38:23 PDT 2024
================
@@ -1582,3 +1583,449 @@ void VPlanTransforms::createInterleaveGroups(
}
}
}
+
+namespace {
+
+/// Helper to hold state needed for unrolling. It holds the Plan to unroll by
+/// UF. It also holds copies of VPValues across UF-1 unroll parts to facilitate
+/// the unrolling transformation, where the original VPValues are retained for
+/// part zero.
+class UnrollState {
+ /// Plan to unroll.
+ VPlan &Plan;
+ /// Unroll factor to unroll by.
+ const unsigned UF;
+ /// Analysis for types.
+ VPTypeAnalysis TypeInfo;
+
+ /// Unrolling may create recipes that should not be unrolled themselves.
+ /// Those are tracked in ToSkip.
+ SmallPtrSet<VPRecipeBase *, 8> ToSkip;
+
+ // Associate with each VPValue of part 0 its unrolled instances of parts 1,
+ // ..., UF-1.
+ DenseMap<VPValue *, SmallVector<VPValue *>> VPV2Parts;
+
+ void unrollReplicateRegion(VPRegionBlock *VPR);
+ void unrollRecipe(VPRecipeBase &R);
----------------
fhahn wrote:
Done, thanks!
https://github.com/llvm/llvm-project/pull/95842
More information about the llvm-commits
mailing list