[llvm-branch-commits] [llvm] [VPlan][Predicator] Simplify block mask by using PostDomFrontier (PR #186478)

Luke Lau via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Mar 18 04:02:31 PDT 2026


lukel97 wrote:

> would technically re-create `BB5`'s mask when computing the mask for `TheBlock`. 

#184838 has the same problem but it just addresses it by deferring the creation of edges. Then it can check if there's the same number of edges to be ORd as predecessors to the block, then it reuses the block mask:

```
      // If the blend mask uses all the edges to Dst, reuse Dst's block-in mask.
      if (Preds.size() == Dst->getNumPredecessors()) {
        Mask = Mask ? Builder.createOr(Mask, getBlockInMask(Dst))
                    : getBlockInMask(Dst);
        continue;
      }
```

Without this it saw regressions in the in-tree tests because we were duplicating masks between blend masks + block in masks.

You could do something similar here for each predecessor of VPBB. But I agree that I'm not worried about this in practice given that we shouldn't really see this with structured control flow

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


More information about the llvm-branch-commits mailing list