@@ -1171,7 +1171,7 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
11711171SmallVector<Instruction *, 4 >
11721172RecurrenceDescriptor::getReductionOpChain (PHINode *Phi, Loop *L) const {
11731173 SmallVector<Instruction *, 4 > ReductionOperations;
1174- bool IsArithmetic = isArithmeticRecurrenceKind (Kind);
1174+ bool IsNonArithmetic = ! isArithmeticRecurrenceKind (Kind);
11751175
11761176 // Search down from the Phi to the LoopExitInstr, looking for instructions
11771177 // with a single user of the correct type for the reduction.
@@ -1189,15 +1189,15 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
11891189 // more expensive than out-of-loop reductions, and need to be costed more
11901190 // carefully.
11911191 unsigned ExpectedUses = 1 ;
1192- if (!IsArithmetic )
1192+ if (IsNonArithmetic )
11931193 ExpectedUses = 2 ;
11941194
11951195 auto getNextInstruction = [&](Instruction *Cur) -> Instruction * {
11961196 for (auto *User : Cur->users ()) {
11971197 Instruction *UI = cast<Instruction>(User);
11981198 if (isa<PHINode>(UI))
11991199 continue ;
1200- if (!IsArithmetic ) {
1200+ if (IsNonArithmetic ) {
12011201 // We are expecting a icmp/select pair, which we go to the next select
12021202 // instruction if we can. We already know that Cur has 2 uses.
12031203 if (isa<SelectInst>(UI))
@@ -1209,7 +1209,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
12091209 return nullptr ;
12101210 };
12111211 auto isCorrectOpcode = [&](Instruction *Cur) {
1212- if (!IsArithmetic ) {
1212+ if (IsNonArithmetic ) {
12131213 Value *LHS, *RHS;
12141214 return SelectPatternResult::isMinOrMax (
12151215 matchSelectPattern (Cur, LHS, RHS).Flavor );
0 commit comments