[llvm] [LV] Extend FindFirstIV to unsigned case (PR #146386)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 9 03:49:55 PDT 2025
================
@@ -674,13 +675,13 @@ RecurrenceDescriptor::isAnyOfPattern(Loop *Loop, PHINode *OrigPhi,
// %spec.select = select i1 %cmp, i32 %i, i32 %r
// %inc = add nsw i32 %i, 1
// ...
-// Since 'i' is an increasing induction variable, the reduction value after the
-// loop will be the maximum value of 'i' that the condition (src[i] > 3) is
-// satisfied, or the start value (0 in the example above). When the start value
-// of the increasing induction variable 'i' is greater than the minimum value of
-// the data type, we can use the minimum value of the data type as a sentinel
-// value to replace the start value. This allows us to perform a single
-// reduction max operation to obtain the final reduction result.
+// Since 'i' is an induction variable, the reduction value after the loop will
+// be the maximum value of 'i' that the condition (src[i] > 3) is satisfied, or
----------------
fhahn wrote:
```suggestion
// be the maximum (increasing induction) or minimum (decreasing induction) value of 'i' that the condition (src[i] > 3) is satisfied, or
```
https://github.com/llvm/llvm-project/pull/146386
More information about the llvm-commits
mailing list