[llvm] [VPlan] Insert VPBlendRecipes in post order. NFC (PR #201782)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 10:51:08 PDT 2026


lukel97 wrote:

> One could argue that we can go BB1->BB2->BB3, but it's dictated by the RPOT and you can simply mirror image the CFG to still have the linearization order where BB2 is processed last.

Can we not do this processing in post order? I.e. after linearization (no new blocks are created AFAIK):

```
  BB0
  BB1
  BB3
  / \
 E1 E2 (both are sill masked with !BB1.Div)
   \ /
   |
  BB2
   |
  MergeBB (phi)
```

We would visit MergeBB and see the original phi. E1 + E2 don't dominate MergeBB so we would decide to insert a phi in BB2, and then replace the original phi with a blend. The incoming values are the new phi and BB2's incoming value, blended.


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


More information about the llvm-commits mailing list