[llvm] IVDesc: unify RecurKinds IAnyOf and FAnyOf (PR #118393)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 20 06:58:39 PST 2025


================
@@ -48,10 +48,8 @@ enum class RecurKind {
   FMinimum, ///< FP min with llvm.minimum semantics
   FMaximum, ///< FP max with llvm.maximum semantics
   FMulAdd,  ///< Sum of float products with llvm.fmuladd(a * b + sum).
-  IAnyOf,   ///< Any_of reduction with select(icmp(),x,y) where one of (x,y) is
-            ///< loop invariant, and both x and y are integer type.
-  FAnyOf,   ///< Any_of reduction with select(fcmp(),x,y) where one of (x,y) is
-            ///< loop invariant, and both x and y are integer type.
+  AnyOf,    ///< Any_of reduction with select(icmp(),x,y) where one of (x,y) is
----------------
ayalz wrote:

+1

Moreover, suggest to simplify and replace `icmp()` with `i1`: `AnyOf` is conceptually a boolean reduction - neither integer nor floating point. It reduces multiple i1's into a single i1, regardless of how the original i1's are produced - via icmp or fcmp comparisons, trunc, whatnot. Sounds reasonable?

OTOH, i1 is admittedly an integer, and AnyOr can be considered an additional pattern of Or reduction? (Or Max reduction - but that just complicated matters.)

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


More information about the llvm-commits mailing list