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

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 03:51:37 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; }
----------------
huntergr-arm wrote:

The extra 1 would disappear during integer division. 

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


More information about the llvm-commits mailing list