diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp index 76552e7488eb5..a216b0347b9fa 100644 --- a/llvm/lib/Analysis/IVDescriptors.cpp +++ b/llvm/lib/Analysis/IVDescriptors.cpp @@ -1189,7 +1189,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) { SmallVector RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const { SmallVector ReductionOperations; - unsigned RedOp = getOpcode(); const bool IsMinMax = isMinMaxRecurrenceKind(Kind); // Search down from the Phi to the LoopExitInstr, looking for instructions @@ -1237,7 +1236,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const { if (isFMulAddIntrinsic(Cur)) return true; - return Cur->getOpcode() == RedOp; + return Cur->getOpcode() == getOpcode(); }; // Attempt to look through Phis which are part of the reduction chain