@@ -1068,7 +1068,7 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
1068
1068
SmallVector<Instruction *, 4 >
1069
1069
RecurrenceDescriptor::getReductionOpChain (PHINode *Phi, Loop *L) const {
1070
1070
SmallVector<Instruction *, 4 > ReductionOperations;
1071
- bool IsArithmetic = isArithmeticRecurrenceKind (Kind);
1071
+ bool IsNonArithmetic = ! isArithmeticRecurrenceKind (Kind);
1072
1072
1073
1073
// Search down from the Phi to the LoopExitInstr, looking for instructions
1074
1074
// with a single user of the correct type for the reduction.
@@ -1086,15 +1086,15 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
1086
1086
// more expensive than out-of-loop reductions, and need to be costed more
1087
1087
// carefully.
1088
1088
unsigned ExpectedUses = 1 ;
1089
- if (!IsArithmetic )
1089
+ if (IsNonArithmetic )
1090
1090
ExpectedUses = 2 ;
1091
1091
1092
1092
auto getNextInstruction = [&](Instruction *Cur) -> Instruction * {
1093
1093
for (auto *User : Cur->users ()) {
1094
1094
Instruction *UI = cast<Instruction>(User);
1095
1095
if (isa<PHINode>(UI))
1096
1096
continue ;
1097
- if (!IsArithmetic ) {
1097
+ if (IsNonArithmetic ) {
1098
1098
// We are expecting a icmp/select pair, which we go to the next select
1099
1099
// instruction if we can. We already know that Cur has 2 uses.
1100
1100
if (isa<SelectInst>(UI))
@@ -1106,7 +1106,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
1106
1106
return nullptr ;
1107
1107
};
1108
1108
auto isCorrectOpcode = [&](Instruction *Cur) {
1109
- if (!IsArithmetic ) {
1109
+ if (IsNonArithmetic ) {
1110
1110
Value *LHS, *RHS;
1111
1111
return SelectPatternResult::isMinOrMax (
1112
1112
matchSelectPattern (Cur, LHS, RHS).Flavor );
0 commit comments