Skip to content

Commit 0128fe7

Browse files
committed
[VPlan] Fix nits
1 parent a7cbc24 commit 0128fe7

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7570,10 +7570,10 @@ createWidenInductionRecipes(PHINode *Phi, Instruction *PhiOrTrunc,
75707570
assert(SE.isLoopInvariant(IndDesc.getStep(), &OrigLoop) &&
75717571
"step must be loop invariant");
75727572

7573-
// It is always safe to copy over the NoWrap flags. In particular, when
7574-
// folding tail by masking, the masked-off lanes are never executed, so it is
7575-
// safe.
7576-
VPIRFlags Flags = vputils::getNoWrapFlagsFromIndDesc(IndDesc);
7573+
// It is always safe to copy over the NoWrap and FastMath flags. In
7574+
// particular, when folding tail by masking, the masked-off lanes are never
7575+
// executed, so it is safe.
7576+
VPIRFlags Flags = vputils::getFlagsFromIndDesc(IndDesc);
75777577
VPValue *Step =
75787578
vputils::getOrCreateVPValueForSCEVExpr(Plan, IndDesc.getStep());
75797579
if (auto *TruncI = dyn_cast<TruncInst>(PhiOrTrunc)) {

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ bool VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(
8080
VPValue *Start = Plan.getOrAddLiveIn(II->getStartValue());
8181
VPValue *Step =
8282
vputils::getOrCreateVPValueForSCEVExpr(Plan, II->getStep());
83-
// It is always safe to copy over the NoWrap flags. In particular,
84-
// when folding tail by masking, the masked-off lanes are never
85-
// executed, so it is safe.
86-
VPIRFlags Flags = vputils::getNoWrapFlagsFromIndDesc(*II);
83+
// It is always safe to copy over the NoWrap and FastMath flags. In
84+
// particular, when folding tail by masking, the masked-off lanes are
85+
// never executed, so it is safe.
86+
VPIRFlags Flags = vputils::getFlagsFromIndDesc(*II);
8787
NewRecipe = new VPWidenIntOrFpInductionRecipe(
8888
Phi, Start, Step, &Plan.getVF(), *II, Flags,
8989
Ingredient.getDebugLoc());

llvm/lib/Transforms/Vectorize/VPlanUtils.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ getRecipesForUncountableExit(VPlan &Plan,
7272
SmallVectorImpl<VPRecipeBase *> &Recipes,
7373
SmallVectorImpl<VPRecipeBase *> &GEPs);
7474

75-
/// Extracts and returns nowrap flags from the induction binop in \p ID.
76-
inline VPIRFlags getNoWrapFlagsFromIndDesc(const InductionDescriptor &ID) {
75+
/// Extracts and returns NoWrap and FastMath flags from the induction binop in
76+
/// \p ID.
77+
inline VPIRFlags getFlagsFromIndDesc(const InductionDescriptor &ID) {
7778
if (ID.getKind() == InductionDescriptor::IK_FpInduction)
7879
return ID.getInductionBinOp()->getFastMathFlags();
7980

0 commit comments

Comments
 (0)