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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 22 06:04:51 PDT 2024


================
@@ -2048,19 +2048,25 @@ class VPBlendRecipe : public VPSingleDefRecipe {
 
   VP_CLASSOF_IMPL(VPDef::VPBlendSC)
 
-  /// Return the number of incoming values, taking into account that the first
-  /// incoming value has no mask.
-  unsigned getNumIncomingValues() const { return (getNumOperands() + 1) / 2; }
+  /// 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; }
----------------
paulwalker-arm wrote:

I've investigated a little and to me this change makes VBlend harder to work with.  Nothing major, just minor things like not being able to write `for i = 1 < num_of_coming values`.  What do you think about VBlend taking an explicit initial value which the masked operands are blended in to?  For most cases this would be `undef` or perhaps `poison` assuming we're happy to always lose the poison during normalisation.

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


More information about the llvm-commits mailing list