[llvm] [LoopVectorize][NFC] Simplify ScaledReductionExitInstrs map (PR #123368)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 05:45:24 PST 2025


================
@@ -8803,9 +8803,9 @@ VPRecipeBuilder::tryToCreateWidenRecipe(Instruction *Instr,
              Phi->getIncomingValueForBlock(OrigLoop->getLoopPreheader()));
 
       // If the PHI is used by a partial reduction, set the scale factor.
-      std::optional<std::pair<PartialReductionChain, unsigned>> Pair =
-          getScaledReductionForInstr(RdxDesc.getLoopExitInstr());
-      unsigned ScaleFactor = Pair ? Pair->second : 1;
+      std::optional<unsigned> Scale =
+          getScalingForReduction(RdxDesc.getLoopExitInstr());
+      unsigned ScaleFactor = Scale.value_or(1);
----------------
david-arm wrote:

Good suggestion. Done!

https://github.com/llvm/llvm-project/pull/123368


More information about the llvm-commits mailing list