@@ -2290,8 +2290,7 @@ void VPReductionRecipe::execute(VPTransformState &State) {
22902290 " In-loop AnyOf reductions aren't currently supported" );
22912291 // Propagate the fast-math flags carried by the underlying instruction.
22922292 IRBuilderBase::FastMathFlagGuard FMFGuard (State.Builder );
2293- if (hasFastMathFlags ())
2294- State.Builder .setFastMathFlags (getFastMathFlags ());
2293+ State.Builder .setFastMathFlags (getFastMathFlags ());
22952294 State.setDebugLocFrom (getDebugLoc ());
22962295 Value *NewVecOp = State.get (getVecOp ());
22972296 if (VPValue *Cond = getCondOp ()) {
@@ -2338,8 +2337,7 @@ void VPReductionEVLRecipe::execute(VPTransformState &State) {
23382337 // Propagate the fast-math flags carried by the underlying instruction.
23392338 IRBuilderBase::FastMathFlagGuard FMFGuard (Builder);
23402339 const RecurrenceDescriptor &RdxDesc = getRecurrenceDescriptor ();
2341- if (hasFastMathFlags ())
2342- Builder.setFastMathFlags (getFastMathFlags ());
2340+ Builder.setFastMathFlags (getFastMathFlags ());
23432341
23442342 RecurKind Kind = RdxDesc.getRecurrenceKind ();
23452343 Value *Prev = State.get (getChainOp (), /* IsScalar*/ true );
@@ -2376,8 +2374,7 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
23762374 Type *ElementTy = Ctx.Types .inferScalarType (this );
23772375 auto *VectorTy = cast<VectorType>(toVectorTy (ElementTy, VF));
23782376 unsigned Opcode = RdxDesc.getOpcode ();
2379- FastMathFlags FMFs =
2380- hasFastMathFlags () ? getFastMathFlags () : FastMathFlags ();
2377+ FastMathFlags FMFs = getFastMathFlags ();
23812378
23822379 // TODO: Support any-of and in-loop reductions.
23832380 assert (
@@ -2413,7 +2410,8 @@ void VPReductionRecipe::print(raw_ostream &O, const Twine &Indent,
24132410 O << " = " ;
24142411 getChainOp ()->printAsOperand (O, SlotTracker);
24152412 O << " +" ;
2416- printFlags (O);
2413+ if (isa<FPMathOperator>(getUnderlyingInstr ()))
2414+ printFlags (O);
24172415 O << " reduce." << Instruction::getOpcodeName (RdxDesc.getOpcode ()) << " (" ;
24182416 getVecOp ()->printAsOperand (O, SlotTracker);
24192417 if (isConditional ()) {
@@ -2434,7 +2432,8 @@ void VPReductionEVLRecipe::print(raw_ostream &O, const Twine &Indent,
24342432 O << " = " ;
24352433 getChainOp ()->printAsOperand (O, SlotTracker);
24362434 O << " +" ;
2437- printFlags (O);
2435+ if (isa<FPMathOperator>(getUnderlyingInstr ()))
2436+ printFlags (O);
24382437 O << " vp.reduce." << Instruction::getOpcodeName (RdxDesc.getOpcode ()) << " (" ;
24392438 getVecOp ()->printAsOperand (O, SlotTracker);
24402439 O << " , " ;
0 commit comments