[llvm] [LLVM][VPlan] Keep all VPBlend masks until VPlan transformation. (PR #104015)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 16:11:38 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; }
----------------
ayalz wrote:
Operands that may or may not be present typically appear last, thereby fixing the access to all other operands. While we're making changes here, how about reversing the order of operand pairs, so that the last operand drops its mask rather than the first?
Note that an absent mask represents a full mask elsewhere in VPlan, so best clarify that this last mask is dropped because it is not needed rather than because it is known to be full. The last mask can be retained (until execution) rather than dropped but doing so might prevent dead code elimination.
https://github.com/llvm/llvm-project/pull/104015
More information about the llvm-commits
mailing list