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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 21 08:42:57 PST 2025


================
@@ -933,7 +933,8 @@ bool VPlanTransforms::handleMaxMinNumReductions(VPlan &Plan) {
 
     // If we exit early due to NaNs, compute the final reduction result based on
     // the reduction phi at the beginning of the last vector iteration.
-    auto *RdxResult = findComputeReductionResult(RedPhiR);
+    auto *RdxResult =
+        findReductionUser(RedPhiR, VPInstruction::ComputeReductionResult);
----------------
fhahn wrote:

That is selecting the index of both the maximum and minimum? I can add that

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


More information about the llvm-commits mailing list