[llvm] [VPlan] Expand VPBlendRecipe earlier in simplifyBlends (PR #171851)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 8 06:33:45 PST 2026


================
@@ -7118,11 +7113,30 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
             cast<VPRecipeWithIRFlags>(R).getPredicate() !=
                 cast<CmpInst>(UI)->getPredicate())
           return true;
+
+        // Keep track of how many select VPInstructions (not replicates) are
+        // used for a phi.
+        if (auto *PHI = dyn_cast<PHINode>(UI)) {
+          if (match(&R, m_VPInstruction<Instruction::Select>(
+                            m_VPValue(), m_VPValue(), m_VPValue()))) {
----------------
artagnon wrote:

```suggestion
          if (match(&R, m_VPInstruction<Instruction::Select>())) {
```

We have a special case for matching opcode on 0 operands.

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


More information about the llvm-commits mailing list