[llvm] [VPlan] Peek through nested phi incoming values in computeBlendMasks (PR #203164)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 2 23:04:59 PDT 2026


================
@@ -293,6 +297,17 @@ VPPredicator::computeBlendEdges(VPPhi *Phi) {
     for (EdgeTy Edge : OutEdges)
       Edges.erase(Edge);
 
+    // If the value is a phi postdominated by VPBB, then look through the inner
+    // incoming values instead of propagating the phi.
+    if (auto *Phi = dyn_cast<VPPhi>(Common))
+      if (Phi->hasOneUse() && VPPDT.dominates(VPBB, Phi->getParent())) {
+        for (auto [InV, InVPBB] : Phi->incoming_values_and_blocks()) {
+          AddEdge(InVPBB, Phi->getParent(), InV);
----------------
lukel97 wrote:

Fixed in f391e26ecec4c638dc8b46938ce1811c490fb1fc, thanks

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


More information about the llvm-commits mailing list