[llvm] [LV] Vectorize selecting last IV of min/max element. (PR #141431)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 07:11:05 PST 2025


================
@@ -8162,13 +8174,19 @@ VPRecipeBase *VPRecipeBuilder::tryToCreateWidenRecipe(VPSingleDefRecipe *R,
           getScalingForReduction(RdxDesc.getLoopExitInstr()).value_or(1);
       PhiRecipe = new VPReductionPHIRecipe(
           Phi, RdxDesc.getRecurrenceKind(), *StartV, CM.isInLoopReduction(Phi),
-          CM.useOrderedReductions(RdxDesc), ScaleFactor);
-    } else {
+          CM.useOrderedReductions(RdxDesc), ScaleFactor,
+          RdxDesc.isPhiMultiUse());
+    } else if (Legal->isFixedOrderRecurrence(Phi)) {
----------------
fhahn wrote:

This has now been removed, not needed in the latest version, also restored the assert above

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


More information about the llvm-commits mailing list