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

via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 02:19:25 PDT 2024


================
@@ -1932,14 +1932,12 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe {
 class VPBlendRecipe : public VPSingleDefRecipe {
 public:
   /// The blend operation is a User of the incoming values and of their
-  /// respective masks, ordered [I0, I1, M1, ...]. Note that the first incoming
-  /// value does not have a mask associated.
+  /// respective masks, ordered [I0, I1, M1, I2, M2, ...]. Note that the first
+  /// incoming value does not have a mask associated.
   VPBlendRecipe(PHINode *Phi, ArrayRef<VPValue *> Operands)
       : VPSingleDefRecipe(VPDef::VPBlendSC, Operands, Phi, Phi->getDebugLoc()) {
-    assert(Operands.size() > 0 &&
-           ((Operands.size() == 1) || ((Operands.size() + 1) % 2 == 0)) &&
-           "Expected either a single incoming value or a positive even number "
-           "of operands");
+    assert(Operands.size() > 0 && (Operands.size() + 1) % 2 == 0 &&
+           "Expected an odd number of operands");
----------------
ayalz wrote:

```suggestion
    assert(Operands.size() % 2 == 1 && "Expected an odd number of operands");
```
?

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


More information about the llvm-commits mailing list