@@ -1068,7 +1068,7 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
10681068SmallVector<Instruction *, 4 >
10691069RecurrenceDescriptor::getReductionOpChain (PHINode *Phi, Loop *L) const {
10701070 SmallVector<Instruction *, 4 > ReductionOperations;
1071- bool IsArithmetic = isArithmeticRecurrenceKind (Kind);
1071+ bool IsNonArithmetic = ! isArithmeticRecurrenceKind (Kind);
10721072
10731073 // Search down from the Phi to the LoopExitInstr, looking for instructions
10741074 // with a single user of the correct type for the reduction.
@@ -1086,15 +1086,15 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
10861086 // more expensive than out-of-loop reductions, and need to be costed more
10871087 // carefully.
10881088 unsigned ExpectedUses = 1 ;
1089- if (!IsArithmetic )
1089+ if (IsNonArithmetic )
10901090 ExpectedUses = 2 ;
10911091
10921092 auto getNextInstruction = [&](Instruction *Cur) -> Instruction * {
10931093 for (auto *User : Cur->users ()) {
10941094 Instruction *UI = cast<Instruction>(User);
10951095 if (isa<PHINode>(UI))
10961096 continue ;
1097- if (!IsArithmetic ) {
1097+ if (IsNonArithmetic ) {
10981098 // We are expecting a icmp/select pair, which we go to the next select
10991099 // instruction if we can. We already know that Cur has 2 uses.
11001100 if (isa<SelectInst>(UI))
@@ -1106,7 +1106,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
11061106 return nullptr ;
11071107 };
11081108 auto isCorrectOpcode = [&](Instruction *Cur) {
1109- if (!IsArithmetic ) {
1109+ if (IsNonArithmetic ) {
11101110 Value *LHS, *RHS;
11111111 return SelectPatternResult::isMinOrMax (
11121112 matchSelectPattern (Cur, LHS, RHS).Flavor );
0 commit comments