[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 03:58:41 PST 2025


================
@@ -2419,6 +2422,10 @@ class VPReductionPHIRecipe : public VPHeaderPHIRecipe,
   /// The phi is part of an ordered reduction. Requires IsInLoop to be true.
   bool IsOrdered;
 
+  /// The phi is part of a multi-use reduction (e.g., used in FindLastIV
+  /// patterns).
----------------
fhahn wrote:

I think that should be covered by negative test `test_vectorize_select_umin_via_select_idx` in `llvm/test/Transforms/LoopVectorize/select-umin-last-index.ll` and similar tests in other files.

Added a TODO, thanks

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


More information about the llvm-commits mailing list