[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:43:50 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:
This looks incorrect when the recipe is not normalised. Should it be
```
unsigned getNumIncomingValues() const { return (getNumOperands() + isNormalized()) / 2; }
```
?
https://github.com/llvm/llvm-project/pull/104015
More information about the llvm-commits
mailing list