[llvm] IVDesc: unify RecurKinds IAnyOf and FAnyOf (PR #118393)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 6 01:36:07 PST 2024
================
@@ -500,7 +497,7 @@ bool RecurrenceDescriptor::AddReductionVar(
// This means we have seen one but not the other instruction of the
// pattern or more than just a select and cmp. Zero implies that we saw a
// llvm.min/max intrinsic, which is always OK.
- if (isMinMaxRecurrenceKind(Kind) && NumCmpSelectPatternInst != 2 &&
+ if (isMinMaxRecurrenceKind(Kind) && NumCmpSelectPatternInst != 1 &&
----------------
Mel-Chen wrote:
Hmm, I think I understand why you needed to modify the part of min/max. However, I believe this might not be necessary.
`NumCmpSelectPatternInst` appears to be redundant for min/max patterns, as the existing checks already ensure that the required pattern is recognized. https://github.com/llvm/llvm-project/pull/118943
For the AnyOf pattern, if we keep the current approach—allowing cmp in the recurrence chain but not strictly requiring it—then we only need to confirm that the AnyOf pattern includes a select.
https://github.com/llvm/llvm-project/pull/118393
More information about the llvm-commits
mailing list