[flang-commits] [flang] [llvm] [VPlan] Fix wrap-flags on WidenInduction unroll (PR #187710)

Florian Hahn via flang-commits flang-commits at lists.llvm.org
Mon Mar 23 04:09:12 PDT 2026


================
@@ -214,12 +219,10 @@ void UnrollState::unrollWidenInductionByUF(
     AddFlags = GEPNoWrapFlags::none();
   } else if (IVTy->isFloatingPointTy()) {
     AddOpc = ID.getInductionOpcode();
-    AddFlags = Flags; // FMF flags
+    AddFlags = FMF;
   } else {
     AddOpc = Instruction::Add;
-    AddFlags = VPIRFlags::getDefaultFlags(AddOpc);
-    if (cast<VPWidenIntOrFpInductionRecipe>(IV)->isCanonical())
-      AddFlags = VPIRFlags::WrapFlagsTy(/*NUW=*/true, /*NSW=*/false);
----------------
fhahn wrote:

what's the rational for remove this? IIRC the reasoning why this should be fine was that we can only wrap around to zero on the last increment of the IV, and the created steps for lanes are at least 1 less that value?

https://github.com/llvm/llvm-project/pull/187710


More information about the flang-commits mailing list