@@ -62,6 +62,11 @@ bool RecurrenceDescriptor::isFloatingPointRecurrenceKind(RecurKind Kind) {
6262 return (Kind != RecurKind::None) && !isIntegerRecurrenceKind (Kind);
6363}
6464
65+ bool RecurrenceDescriptor::isArithmeticRecurrenceKind (RecurKind Kind) {
66+ return (Kind != RecurKind::None) && !isMinMaxRecurrenceKind (Kind) &&
67+ !isAnyOfRecurrenceKind (Kind);
68+ }
69+
6570// / Determines if Phi may have been type-promoted. If Phi has a single user
6671// / that ANDs the Phi with a type mask, return the user. RT is updated to
6772// / account for the narrower bit width represented by the mask, and the AND
@@ -1166,7 +1171,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
11661171SmallVector<Instruction *, 4 >
11671172RecurrenceDescriptor::getReductionOpChain (PHINode *Phi, Loop *L) const {
11681173 SmallVector<Instruction *, 4 > ReductionOperations;
1169- unsigned RedOp = getOpcode ();
11701174 const bool IsMinMax = isMinMaxRecurrenceKind (Kind);
11711175
11721176 // Search down from the Phi to the LoopExitInstr, looking for instructions
@@ -1214,7 +1218,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
12141218 if (isFMulAddIntrinsic (Cur))
12151219 return true ;
12161220
1217- return Cur->getOpcode () == RedOp ;
1221+ return Cur->getOpcode () == getOpcode () ;
12181222 };
12191223
12201224 // Attempt to look through Phis which are part of the reduction chain
0 commit comments