[llvm] [VPlan] Extend licm to hoist replicate loads (PR #179506)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 03:12:43 PDT 2026


================
@@ -2695,7 +2723,9 @@ static void licm(VPlan &Plan) {
   for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(
            vp_depth_first_shallow(LoopRegion->getEntry()))) {
     for (VPRecipeBase &R : make_early_inc_range(*VPBB)) {
-      if (cannotHoistOrSinkRecipe(R))
+      if (cannotHoistOrSinkRecipe(R, LoadGroups,
+                                  LoopRegion->getEntryBasicBlock(),
+                                  LoopRegion->getExitingBasicBlock()))
----------------
artagnon wrote:

Hm, cannotHoistOrSinkRecipe is a mechanical check on the recipe itself, and not considering any loop context or anything previously hoisted/sunk, based on things like side-effects? It's similar to the check in the IR LICM?

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


More information about the llvm-commits mailing list