[llvm] [VPlan] Materialize constant vector trip counts before final opts. (PR #142309)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 6 03:59:48 PDT 2025


================
@@ -1900,12 +1898,9 @@ static void removeBranchOnConst(VPlan &Plan) {
            "There must be a single edge between VPBB and its successor");
     // Values coming from VPBB into phi recipes of RemoveSucc are removed from
     // these recipes.
-    for (VPRecipeBase &R : RemovedSucc->phis()) {
-      auto *Phi = cast<VPPhiAccessors>(&R);
-      assert((!isa<VPIRPhi>(&R) || RemovedSucc->getNumPredecessors() == 1) &&
-             "VPIRPhis must have a single predecessor");
----------------
fhahn wrote:

Yep, we now can handle phis generally via `VPPhiAccessors::removeIncomingValueFor`

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


More information about the llvm-commits mailing list