diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index b03fb203c6d75..baa8ce2638a0d 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -6772,7 +6772,8 @@ class HorizontalReduction { // in this case. // Do not perform analysis of remaining operands of ParentStackElem.first // instruction, this whole instruction is an extra argument. - ParentStackElem.second = ParentStackElem.first->getNumOperands(); + OperationData OpData = getOperationData(ParentStackElem.first); + ParentStackElem.second = OpData.getNumberOfOperands(); } else { // We ran into something like: // ParentStackElem.first += ... + ExtraArg + ...