diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp index ca202ccd913cd5..6bcb4c7af73ab1 100644 --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -18005,7 +18005,7 @@ class HorizontalReduction { /// List of possibly reduced values. SmallVector> ReducedVals; /// Maps reduced value to the corresponding reduction operation. - DenseMap> ReducedValsToOps; + SmallDenseMap, 16> ReducedValsToOps; WeakTrackingVH ReductionRoot; /// The type of reduction operation. RecurKind RdxKind; @@ -18374,7 +18374,9 @@ class HorizontalReduction { // instruction op id and/or alternate op id, plus do extra analysis for // loads (grouping them by the distabce between pointers) and cmp // instructions (grouping them by the predicate). - MapVector>> + SmallMapVector< + size_t, SmallMapVector, 2>, + 8> PossibleReducedVals; initReductionOps(Root); DenseMap> LoadsMap;