[llvm] [VPlan] Remove unused first mask op from VPBlendRecipe. (PR #87770)

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 04:16:03 PDT 2024


================
@@ -8245,6 +8245,8 @@ VPBlendRecipe *VPRecipeBuilder::tryToBlend(PHINode *Phi,
              "Distinct incoming values with one having a full mask");
       break;
     }
+    if (In == 0)
+      continue;
----------------
ayalz wrote:

> pushed 9430a4b to replace createEdgeMask to with getEdgeMask to make it clear that no new edge-mask is created, only the existing one retrieved.

Good catch!

> Unfortunately we can't use an early continue at the top ...

Hence the restructuring proposed above, which may look clearer, early returning after inserting the first operand (w/o its mask) if all operands are the same. Otherwise the masks must be non-null. This takes care of simplifyRecipe(), leaving it to do copy elimination (remove blends of a single element).

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


More information about the llvm-commits mailing list