[llvm] [LLVM][VPlan] Keep all VPBlend masks until VPlan transformation. (PR #104015)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 03:54:23 PDT 2024


================
@@ -2048,19 +2048,23 @@ class VPBlendRecipe : public VPSingleDefRecipe {
 
   VP_CLASSOF_IMPL(VPDef::VPBlendSC)
 
+  /// A normalized blend is one that has an odd number of operands, whereby the
+  /// first operand does not have an associated mask.
+  bool isNormalized() const { return getNumOperands() % 2; }
+
   /// Return the number of incoming values, taking into account that the first
   /// incoming value has no mask.
   unsigned getNumIncomingValues() const { return (getNumOperands() + 1) / 2; }
----------------
david-arm wrote:

Sure, but it still looks a little odd. If the code is relying upon that behaviour then I think it's at least worth a comment somewhere.

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


More information about the llvm-commits mailing list