[llvm] [VPlan] Remove unused first mask op from VPBlendRecipe. (PR #87770)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 9 03:00:52 PDT 2024
================
@@ -1951,13 +1951,18 @@ class VPBlendRecipe : public VPSingleDefRecipe {
/// Return the number of incoming values, taking into account that a single
/// incoming value has no mask.
- unsigned getNumIncomingValues() const { return (getNumOperands() + 1) / 2; }
+ unsigned getNumIncomingValues() const { return (getNumOperands() + 2) / 2; }
/// Return incoming value number \p Idx.
- VPValue *getIncomingValue(unsigned Idx) const { return getOperand(Idx * 2); }
+ VPValue *getIncomingValue(unsigned Idx) const {
+ return Idx == 0 ? getOperand(0) : getOperand(Idx * 2 - 1);
+ }
/// Return mask number \p Idx.
- VPValue *getMask(unsigned Idx) const { return getOperand(Idx * 2 + 1); }
+ VPValue *getMask(unsigned Idx) const {
+ assert(Idx > 0);
----------------
fhahn wrote:
Added, thanks!
https://github.com/llvm/llvm-project/pull/87770
More information about the llvm-commits
mailing list