Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions llvm/lib/Analysis/IVDescriptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
SmallVector<Instruction *, 4>
RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
SmallVector<Instruction *, 4> ReductionOperations;
unsigned RedOp = getOpcode();
const bool IsMinMax = isMinMaxRecurrenceKind(Kind);

// Search down from the Phi to the LoopExitInstr, looking for instructions
Expand Down Expand Up @@ -1237,7 +1236,7 @@ RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
if (isFMulAddIntrinsic(Cur))
return true;

return Cur->getOpcode() == RedOp;
return Cur->getOpcode() == getOpcode();
Comment on lines -1240 to +1239
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're checking for opcode here anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only arithmetic reductions call getOpcode and check the opcode, non-arithmetic won't reach this check statement.

};

// Attempt to look through Phis which are part of the reduction chain
Expand Down