[flang] [llvm] [VPlan] Expand WidenInt inductions with nuw/nsw (PR #163538)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 26 20:18:46 PDT 2025
================
@@ -7549,16 +7549,20 @@ createWidenInductionRecipes(PHINode *Phi, Instruction *PhiOrTrunc,
assert(SE.isLoopInvariant(IndDesc.getStep(), &OrigLoop) &&
"step must be loop invariant");
+ // It is always safe to copy over the NoWrap and FastMath flags. In
+ // particular, when folding tail by masking, the masked-off lanes are never
+ // executed, so it is safe.
----------------
fhahn wrote:
We start out with VPWidenCanonicalIVRecipe if it is needed, and `removeRedundantCanonicalIVs` tries to replace them with a suitable wide induction, if there is one.
For this case, it should be fine to drop NSW, not sure if there are other cases that could cause similar problems, might be good to check if there's anything we can verify?
https://github.com/llvm/llvm-project/pull/163538
More information about the llvm-commits
mailing list