[llvm] [LoopVectorize] Vectorize select-cmp reduction pattern for increasing integer induction variable (PR #67812)
Graham Hunter via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 29 08:19:38 PST 2024
================
@@ -236,10 +253,26 @@ class RecurrenceDescriptor {
return Kind == RecurKind::IAnyOf || Kind == RecurKind::FAnyOf;
}
+ /// Returns true if the recurrence kind is of the form
+ /// select(cmp(),x,y) where one of (x,y) is increasing loop induction.
+ static bool isFindLastIVRecurrenceKind(RecurKind Kind) {
+ return Kind == RecurKind::IFindLastIV || Kind == RecurKind::FFindLastIV;
+ }
+
/// Returns the type of the recurrence. This type can be narrower than the
/// actual type of the Phi if the recurrence has been type-promoted.
Type *getRecurrenceType() const { return RecurrenceType; }
+ /// Returns the sentinel value used to replace the start value.
----------------
huntergr-arm wrote:
nit: Would be nice to clarify that this is a sentinel value specifically for FindLastIV recurrences.
https://github.com/llvm/llvm-project/pull/67812
More information about the llvm-commits
mailing list