@@ -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
@@ -1189,7 +1194,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
1189
1194
SmallVector<Instruction *, 4 >
1190
1195
RecurrenceDescriptor::getReductionOpChain (PHINode *Phi, Loop *L) const {
1191
1196
SmallVector<Instruction *, 4 > ReductionOperations;
1192
- unsigned RedOp = getOpcode ();
1193
1197
const bool IsMinMax = isMinMaxRecurrenceKind (Kind);
1194
1198
1195
1199
// Search down from the Phi to the LoopExitInstr, looking for instructions
@@ -1237,7 +1241,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
1237
1241
if (isFMulAddIntrinsic (Cur))
1238
1242
return true ;
1239
1243
1240
- return Cur->getOpcode () == RedOp ;
1244
+ return Cur->getOpcode () == getOpcode () ;
1241
1245
};
1242
1246
1243
1247
// Attempt to look through Phis which are part of the reduction chain
0 commit comments