[llvm] [SCEV] Preserve nuw on scaled recurrence start values. (PR #227458)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 00:52:00 PDT 2026


================
@@ -3331,8 +3331,12 @@ SCEVUse ScalarEvolution::getMulExpr(SmallVectorImpl<SCEVUse> &Ops,
       SCEVFlags Flags = AddRec->getNoWrapFlags(ComputeFlags({Scale, AddRec}));
 
       for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) {
+        // The initial product is evaluated on the first loop iteration; NUW
+        // also holds for this specific use.
----------------
nikic wrote:

Why only nuw? Isn't this the same for nuw and nsw?

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


More information about the llvm-commits mailing list