Skip to content

Commit 2a0ee09

Browse files
authored
IVDesc: strip redundant arg in getOpcode call (NFC) (#118476)
1 parent ff0babc commit 2a0ee09

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

llvm/lib/Analysis/IVDescriptors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
10631063
SmallVector<Instruction *, 4>
10641064
RecurrenceDescriptor::getReductionOpChain(PHINode *Phi, Loop *L) const {
10651065
SmallVector<Instruction *, 4> ReductionOperations;
1066-
unsigned RedOp = getOpcode(Kind);
1066+
unsigned RedOp = getOpcode();
10671067

10681068
// Search down from the Phi to the LoopExitInstr, looking for instructions
10691069
// with a single user of the correct type for the reduction.

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ Value *VPInstruction::generate(VPTransformState &State) {
550550
}
551551
// Reduce all of the unrolled parts into a single vector.
552552
Value *ReducedPartRdx = RdxParts[0];
553-
unsigned Op = RecurrenceDescriptor::getOpcode(RK);
553+
unsigned Op = RdxDesc.getOpcode();
554554
if (RecurrenceDescriptor::isAnyOfRecurrenceKind(RK))
555555
Op = Instruction::Or;
556556

@@ -2130,8 +2130,7 @@ void VPReductionRecipe::execute(VPTransformState &State) {
21302130
createOrderedReduction(State.Builder, RdxDesc, NewVecOp, PrevInChain);
21312131
else
21322132
NewRed = State.Builder.CreateBinOp(
2133-
(Instruction::BinaryOps)RdxDesc.getOpcode(Kind), PrevInChain,
2134-
NewVecOp);
2133+
(Instruction::BinaryOps)RdxDesc.getOpcode(), PrevInChain, NewVecOp);
21352134
PrevInChain = NewRed;
21362135
NextInChain = NewRed;
21372136
} else {
@@ -2142,7 +2141,7 @@ void VPReductionRecipe::execute(VPTransformState &State) {
21422141
NewRed, PrevInChain);
21432142
else
21442143
NextInChain = State.Builder.CreateBinOp(
2145-
(Instruction::BinaryOps)RdxDesc.getOpcode(Kind), NewRed, PrevInChain);
2144+
(Instruction::BinaryOps)RdxDesc.getOpcode(), NewRed, PrevInChain);
21462145
}
21472146
State.set(this, NextInChain, /*IsScalar*/ true);
21482147
}
@@ -2179,8 +2178,8 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
21792178
if (RecurrenceDescriptor::isMinMaxRecurrenceKind(Kind))
21802179
NewRed = createMinMaxOp(Builder, Kind, NewRed, Prev);
21812180
else
2182-
NewRed = Builder.CreateBinOp(
2183-
(Instruction::BinaryOps)RdxDesc.getOpcode(Kind), NewRed, Prev);
2181+
NewRed = Builder.CreateBinOp((Instruction::BinaryOps)RdxDesc.getOpcode(),
2182+
NewRed, Prev);
21842183
}
21852184
State.set(this, NewRed, /*IsScalar*/ true);
21862185
}

0 commit comments

Comments
 (0)