@@ -48,10 +48,8 @@ enum class RecurKind {
4848 FMinimum, // /< FP min with llvm.minimum semantics
4949 FMaximum, // /< FP max with llvm.maximum semantics
5050 FMulAdd, // /< Sum of float products with llvm.fmuladd(a * b + sum).
51- IAnyOf, // /< Any_of reduction with select(icmp(),x,y) where one of (x,y) is
52- // /< loop invariant, and both x and y are integer type.
53- FAnyOf // /< Any_of reduction with select(fcmp(),x,y) where one of (x,y) is
54- // /< loop invariant, and both x and y are integer type.
51+ AnyOf, // /< Any_of reduction with select(cmp(),x,y) where one of (x,y) is
52+ // /< loop invariant.
5553 // TODO: Any_of reduction need not be restricted to integer type only.
5654};
5755
@@ -156,7 +154,7 @@ class RecurrenceDescriptor {
156154 static InstDesc isConditionalRdxPattern (RecurKind Kind, Instruction *I);
157155
158156 // / Returns the opcode corresponding to the RecurrenceKind.
159- static unsigned getOpcode (RecurKind Kind);
157+ static unsigned getOpcode (RecurKind Kind, Type *Ty );
160158
161159 // / Returns true if Phi is a reduction of type Kind and adds it to the
162160 // / RecurrenceDescriptor. If either \p DB is non-null or \p AC and \p DT are
@@ -192,7 +190,9 @@ class RecurrenceDescriptor {
192190
193191 RecurKind getRecurrenceKind () const { return Kind; }
194192
195- unsigned getOpcode () const { return getOpcode (getRecurrenceKind ()); }
193+ unsigned getOpcode () const {
194+ return getOpcode (getRecurrenceKind (), getRecurrenceType ());
195+ }
196196
197197 FastMathFlags getFastMathFlags () const { return FMF; }
198198
@@ -233,7 +233,7 @@ class RecurrenceDescriptor {
233233 // / Returns true if the recurrence kind is of the form
234234 // / select(cmp(),x,y) where one of (x,y) is loop invariant.
235235 static bool isAnyOfRecurrenceKind (RecurKind Kind) {
236- return Kind == RecurKind::IAnyOf || Kind == RecurKind::FAnyOf ;
236+ return Kind == RecurKind::AnyOf ;
237237 }
238238
239239 // / Returns the type of the recurrence. This type can be narrower than the
0 commit comments