[SLP] use operand index abstraction for number of operands
authorSanjay Patel <spatel@rotateright.com>
Tue, 22 Dec 2020 19:13:39 +0000 (14:13 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 22 Dec 2020 21:05:39 +0000 (16:05 -0500)
commit0d15d4b6f43a3355c1d618766c8e550cfe1481d0
tree298a3f3dcb0d276391ffffde809c26573a027031
parent57ffbe020af6469b7c2fdb599f2f7e5e5d0322f0
[SLP] use operand index abstraction for number of operands

I think this is NFC currently, but the bug would be exposed
when we allow binary intrinsics (maxnum, etc) as candidates
for reductions.

The code in matchAssociativeReduction() is using
OperationData::getNumberOfOperands() when comparing whether
the "EdgeToVisit" iterator is in-bounds, so this code must
use the same (potentially offset) operand value to set
the "EdgeToVisit".
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp