@@ -8711,8 +8711,7 @@ void VPRecipeBuilder::collectScaledReductions(VFRange &Range) {
87118711 PartialReductionChain Chain = Pair.first ;
87128712 if (ExtendIsOnlyUsedByPartialReductions (Chain.ExtendA ) &&
87138713 ExtendIsOnlyUsedByPartialReductions (Chain.ExtendB ))
8714- ScaledReductionExitInstrs.insert (
8715- std::make_pair (Chain.Reduction , Pair.second ));
8714+ ScaledReductionMap.insert (std::make_pair (Chain.Reduction , Pair.second ));
87168715 }
87178716}
87188717
@@ -8805,8 +8804,8 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
88058804
88068805 // If the PHI is used by a partial reduction, set the scale factor.
88078806 std::optional<unsigned > Scale =
8808- getScaledReductionForInstr (RdxDesc.getLoopExitInstr ());
8809- unsigned ScaleFactor = Scale ? *Scale : 1 ;
8807+ getScalingForReduction (RdxDesc.getLoopExitInstr ());
8808+ unsigned ScaleFactor = Scale. value_or ( 1 ) ;
88108809 PhiRecipe = new VPReductionPHIRecipe (
88118810 Phi, RdxDesc, *StartV, CM.isInLoopReduction (Phi),
88128811 CM.useOrderedReductions (RdxDesc), ScaleFactor);
@@ -8841,7 +8840,7 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
88418840 if (isa<LoadInst>(Instr) || isa<StoreInst>(Instr))
88428841 return tryToWidenMemory (Instr, Operands, Range);
88438842
8844- if (getScaledReductionForInstr (Instr))
8843+ if (getScalingForReduction (Instr))
88458844 return tryToCreatePartialReduction (Instr, Operands);
88468845
88478846 if (!shouldWiden (Instr, Range))
0 commit comments