[llvm] [LV] Support argmin/argmax with strict predicates. (PR #170223)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 05:58:58 PST 2026


================
@@ -1406,12 +1406,14 @@ bool VPlanTransforms::handleFindLastReductions(VPlan &Plan) {
 }
 
 /// For an argmin/argmax reduction with strict predicate \p MinOrMaxPhiR,
-/// convert the FindLastIV reduction \p FindLastIVPhiR of induction \p WideIV to
-/// a new UMin reduction of a wide canonical IV. If the original IV was not
-/// canonical, a new canonical wide IV is added, and the final result is scaled
-/// back to the original IV. \p MinOrMaxResult computes the final value of \p
-/// MinOrMaxPhiR and \p FindIVSelect, \p FindIVCmp, \p FindIVRdxResult compute
-/// the final value of \p FindLastIVPhiR.
+/// update the FindLastIV reduction \p FindLastIVPhiR of induction \p WideIV to
+/// to select the first index of the wide canonical IV outside the loop using
+/// UMin or \p FindLastIVPhiR's start value, if \p MinMaxResult equals \p
+/// MinOrMaxPhiR's start value. If \p WideIV was not canonical, a new canonical
+/// wide IV is added, and the final result is scaled back to the original IV. \p
+/// MinOrMaxResult computes the final value of \p MinOrMaxPhiR and \p
+/// FindIVSelect, \p FindIVCmp, \p FindIVRdxResult compute the final value of \p
+/// FindLastIVPhiR.
----------------
fhahn wrote:

thanks, updated with small edits to split up a large sentence.

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


More information about the llvm-commits mailing list