@@ -2312,8 +2312,9 @@ void VPReductionRecipe::execute(VPTransformState &State) {
2312
2312
NewRed =
2313
2313
createOrderedReduction (State.Builder , Kind, NewVecOp, PrevInChain);
2314
2314
else
2315
- NewRed = State.Builder .CreateBinOp ((Instruction::BinaryOps)getOpcode (),
2316
- PrevInChain, NewVecOp);
2315
+ NewRed = State.Builder .CreateBinOp (
2316
+ (Instruction::BinaryOps)RecurrenceDescriptor::getOpcode (Kind),
2317
+ PrevInChain, NewVecOp);
2317
2318
PrevInChain = NewRed;
2318
2319
NextInChain = NewRed;
2319
2320
} else {
@@ -2323,7 +2324,8 @@ void VPReductionRecipe::execute(VPTransformState &State) {
2323
2324
NextInChain = createMinMaxOp (State.Builder , Kind, NewRed, PrevInChain);
2324
2325
else
2325
2326
NextInChain = State.Builder .CreateBinOp (
2326
- (Instruction::BinaryOps)getOpcode (), NewRed, PrevInChain);
2327
+ (Instruction::BinaryOps)RecurrenceDescriptor::getOpcode (Kind), NewRed,
2328
+ PrevInChain);
2327
2329
}
2328
2330
State.set (this , NextInChain, /* IsScalar*/ true );
2329
2331
}
@@ -2359,8 +2361,9 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
2359
2361
if (RecurrenceDescriptor::isMinMaxRecurrenceKind (Kind))
2360
2362
NewRed = createMinMaxOp (Builder, Kind, NewRed, Prev);
2361
2363
else
2362
- NewRed = Builder.CreateBinOp ((Instruction::BinaryOps)getOpcode (), NewRed,
2363
- Prev);
2364
+ NewRed = Builder.CreateBinOp (
2365
+ (Instruction::BinaryOps)RecurrenceDescriptor::getOpcode (Kind), NewRed,
2366
+ Prev);
2364
2367
}
2365
2368
State.set (this , NewRed, /* IsScalar*/ true );
2366
2369
}
@@ -2370,7 +2373,7 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
2370
2373
RecurKind RdxKind = getRecurrenceKind ();
2371
2374
Type *ElementTy = Ctx.Types .inferScalarType (this );
2372
2375
auto *VectorTy = cast<VectorType>(toVectorTy (ElementTy, VF));
2373
- unsigned Opcode = getOpcode ();
2376
+ unsigned Opcode = RecurrenceDescriptor:: getOpcode (RdxKind );
2374
2377
FastMathFlags FMFs = getFastMathFlags ();
2375
2378
2376
2379
// TODO: Support any-of and in-loop reductions.
@@ -2405,7 +2408,10 @@ void VPReductionRecipe::print(raw_ostream &O, const Twine &Indent,
2405
2408
getChainOp ()->printAsOperand (O, SlotTracker);
2406
2409
O << " +" ;
2407
2410
printFlags (O);
2408
- O << " reduce." << Instruction::getOpcodeName (getOpcode ()) << " (" ;
2411
+ O << " reduce."
2412
+ << Instruction::getOpcodeName (
2413
+ RecurrenceDescriptor::getOpcode (getRecurrenceKind ()))
2414
+ << " (" ;
2409
2415
getVecOp ()->printAsOperand (O, SlotTracker);
2410
2416
if (isConditional ()) {
2411
2417
O << " , " ;
@@ -2422,7 +2428,10 @@ void VPReductionEVLRecipe::print(raw_ostream &O, const Twine &Indent,
2422
2428
getChainOp ()->printAsOperand (O, SlotTracker);
2423
2429
O << " +" ;
2424
2430
printFlags (O);
2425
- O << " vp.reduce." << Instruction::getOpcodeName (getOpcode ()) << " (" ;
2431
+ O << " vp.reduce."
2432
+ << Instruction::getOpcodeName (
2433
+ RecurrenceDescriptor::getOpcode (getRecurrenceKind ()))
2434
+ << " (" ;
2426
2435
getVecOp ()->printAsOperand (O, SlotTracker);
2427
2436
O << " , " ;
2428
2437
getEVL ()->printAsOperand (O, SlotTracker);
0 commit comments