[llvm] [VPlan] Add exit phi operands during initial construction (NFC). (PR #136455)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 21 08:05:36 PDT 2025


================
@@ -464,6 +477,12 @@ void VPlanTransforms::createLoopRegions(VPlan &Plan, Type *InductionTy,
   VPBlockUtils::connectBlocks(ScalarPH, Plan.getScalarHeader());
   if (!RequiresScalarEpilogueCheck) {
     VPBlockUtils::connectBlocks(MiddleVPBB, ScalarPH);
+    // The exit blocks are dead, remove any recipes to make sure no users remain
+    // that may pessimize transforms.
----------------
ayalz wrote:

```suggestion
    // The exit blocks are unreachable, remove their recipes to make sure no users remain
    // that may pessimize transforms.
```
Have dce take care of this?
The blocks themselves are collected lazily when the plan is destroyed, hence we don't simply erase the exit blocks here. But should ExitBlocks be emptied?

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


More information about the llvm-commits mailing list