[llvm] [VPlan] Endow DerivedIV with VPIRFlags (PR #205908)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 04:55:27 PDT 2026


================
@@ -683,7 +683,8 @@ createScalarIVSteps(VPlan &Plan, InductionDescriptor::InductionKind Kind,
   VPBasicBlock *HeaderVPBB = LoopRegion->getEntryBasicBlock();
   VPValue *CanonicalIV = LoopRegion->getCanonicalIV();
   VPSingleDefRecipe *BaseIV =
-      Builder.createDerivedIV(Kind, FPBinOp, StartV, CanonicalIV, Step);
+      Builder.createDerivedIV(Kind, FPBinOp, StartV, CanonicalIV, Step,
+                              {LoopRegion->hasCanonicalIVNUW(), false});
----------------
lukel97 wrote:

Why are we taking the nuw flag from the canonicalIV? The derived IV has a different start and step, can't they wrap?

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


More information about the llvm-commits mailing list