[llvm] [VPlan] Add initial loop-invariant code motion transform. (PR #107894)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 13 11:10:42 PDT 2024
================
@@ -1587,3 +1588,24 @@ void VPlanTransforms::createInterleaveGroups(
}
}
}
+
+void VPlanTransforms::licm(VPlan &Plan) {
+ VPRegionBlock *LoopRegion = Plan.getVectorLoopRegion();
+ VPBasicBlock *Preheader =
+ cast<VPBasicBlock>(LoopRegion->getSinglePredecessor());
+ // Hoist any loop invariant recipes from the vector loop region to the
+ // preheader.
+ for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
+ vp_depth_first_shallow(LoopRegion->getEntry()))) {
----------------
artagnon wrote:
Why is this `vp_depth_first_shallow`, and not `vp_depth_first_deep`?
https://github.com/llvm/llvm-project/pull/107894
More information about the llvm-commits
mailing list