@@ -62,6 +62,11 @@ bool RecurrenceDescriptor::isFloatingPointRecurrenceKind(RecurKind Kind) {
62
62
return (Kind != RecurKind::None) && !isIntegerRecurrenceKind (Kind);
63
63
}
64
64
65
+ bool RecurrenceDescriptor::isArithmeticRecurrenceKind (RecurKind Kind) {
66
+ return (Kind != RecurKind::None) && !isMinMaxRecurrenceKind (Kind) &&
67
+ !isAnyOfRecurrenceKind (Kind);
68
+ }
69
+
65
70
// / Determines if Phi may have been type-promoted. If Phi has a single user
66
71
// / that ANDs the Phi with a type mask, return the user. RT is updated to
67
72
// / account for the narrower bit width represented by the mask, and the AND
@@ -1166,7 +1171,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
1166
1171
SmallVector<Instruction *, 4 >
1167
1172
RecurrenceDescriptor::getReductionOpChain (PHINode *Phi, Loop *L) const {
1168
1173
SmallVector<Instruction *, 4 > ReductionOperations;
1169
- unsigned RedOp = getOpcode ();
1170
1174
const bool IsMinMax = isMinMaxRecurrenceKind (Kind);
1171
1175
1172
1176
// Search down from the Phi to the LoopExitInstr, looking for instructions
@@ -1214,7 +1218,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
1214
1218
if (isFMulAddIntrinsic (Cur))
1215
1219
return true ;
1216
1220
1217
- return Cur->getOpcode () == RedOp ;
1221
+ return Cur->getOpcode () == getOpcode () ;
1218
1222
};
1219
1223
1220
1224
// Attempt to look through Phis which are part of the reduction chain
0 commit comments