[PATCH] D155786: [LV] Rename the Select[I|F]Cmp reduction pattern to [I|F]AnyOf. (NFC)
Mel Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 31 02:06:26 PDT 2023
Mel-Chen marked 8 inline comments as done and an inline comment as not done.
Mel-Chen added inline comments.
================
Comment at: llvm/include/llvm/Analysis/IVDescriptors.h:53-54
+ FMulAdd, ///< Fused multiply-add of floats (a * b + c).
+ IAnyOf, ///< Integer select(icmp(),x,y) where one of (x,y) is loop invariant
+ FAnyOf ///< Integer select(fcmp(),x,y) where one of (x,y) is loop invariant
};
----------------
Ayal wrote:
> Mel-Chen wrote:
> > Ayal wrote:
> > >
> > Since currently we only have implemented the integer version of `any_of`, would it be better to retain it specifically for integers?
> > Since currently we only have implemented the integer version of any_of, would it be better to retain it specifically for integers?
>
> Ah, good clarification, worth a TODO somewhere, possibly attached to a negative test: this pattern is easily applicable to x,y of any type. How about:
> ```
> IAnyOf, ///< any_of reduction with select(icmp(),t,f) and invariant t or f (both integers)
> IAnyOf ///< any_of reduction with select(fcmp(),t,f) and invariant t or f (both integers)
>
> ```
> AnyOf is essentially a boolean OR reduction, so should apply to both integer and floating point return values. The predicate producing the reduced values can be provided via icmp or fcmp. The end boolean result could be converted to a {true-value, false value} pair of any type, preferably after the loop. The types of true-value and false-value must match each other, but are independent of the type of comparison.
Re-write comments and added TODO.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155786/new/
https://reviews.llvm.org/D155786
More information about the llvm-commits
mailing list