Skip to content

Commit 04ac4c6

Browse files
committed
[VPlan] Fix nits
1 parent 7a802a2 commit 04ac4c6

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
@@ -7563,10 +7563,10 @@ createWidenInductionRecipes(PHINode *Phi, Instruction *PhiOrTrunc,
75637563
assert(SE.isLoopInvariant(IndDesc.getStep(), &OrigLoop) &&
75647564
"step must be loop invariant");
75657565

7566-
// It is always safe to copy over the NoWrap flags. In particular, when
7567-
// folding tail by masking, the masked-off lanes are never executed, so it is
7568-
// safe.
7569-
VPIRFlags Flags = vputils::getNoWrapFlagsFromIndDesc(IndDesc);
7566+
// It is always safe to copy over the NoWrap and FastMath flags. In
7567+
// particular, when folding tail by masking, the masked-off lanes are never
7568+
// executed, so it is safe.
7569+
VPIRFlags Flags = vputils::getFlagsFromIndDesc(IndDesc);
75707570
VPValue *Step =
75717571
vputils::getOrCreateVPValueForSCEVExpr(Plan, IndDesc.getStep());
75727572
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
@@ -71,8 +71,9 @@ getRecipesForUncountableExit(VPlan &Plan,
7171
SmallVectorImpl<VPRecipeBase *> &Recipes,
7272
SmallVectorImpl<VPRecipeBase *> &GEPs);
7373

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

0 commit comments

Comments
 (0)