[SLP] replace local reduction enum with RecurrenceKind; NFCI
authorSanjay Patel <spatel@rotateright.com>
Tue, 29 Dec 2020 19:21:16 +0000 (14:21 -0500)
committerSanjay Patel <spatel@rotateright.com>
Tue, 29 Dec 2020 19:52:11 +0000 (14:52 -0500)
commit21a3a0225d84cd35227fc9d4d08234918a54f8d3
treea3167c89c79907971beca85be86c301aab0cf1ed
parentf7f09e2b1c897f0b42be72939d0c97dcfd1577f7
[SLP] replace local reduction enum with RecurrenceKind; NFCI

I'm not sure if the SLP enum was created before the IVDescriptor
RecurrenceDescriptor / RecurrenceKind existed, but the code in
SLP is now redundant with that class, so it just makes things
more complicated to have both. We eventually call LoopUtils
createSimpleTargetReduction() to create reduction ops, so we
might as well standardize on those enum names.

There's still a question of whether we need to use TTI::ReductionFlags
vs. MinMaxRecurrenceKind, but that can be another clean-up step.

Another option would just be to flatten the enums in RecurrenceDescriptor
into a single enum. There isn't much benefit (smaller switches?) to
having a min/max subset.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp