[llvm] [VPlan] Extend getSCEVForVPV, use to compute VPReplicateRecipe cost. (PR #161276)
    Ramkumar Ramachandra via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Oct 22 11:00:29 PDT 2025
    
    
  
================
@@ -3842,8 +3842,9 @@ const SCEV *ScalarEvolution::getGEPExpr(const SCEV *BaseExpr,
   // Add the base address and the offset. We cannot use the nsw flag, as the
   // base address is unsigned. However, if we know that the offset is
   // non-negative, we can use nuw.
-  bool NUW = NW.hasNoUnsignedWrap() ||
-             (NW.hasNoUnsignedSignedWrap() && isKnownNonNegative(Offset));
+  bool NUW =
+      hasFlags(OffsetWrap, SCEV::FlagNUW) ||
+      (hasFlags(OffsetWrap, SCEV::FlagNSW) && isKnownNonNegative(Offset));
----------------
artagnon wrote:
By the way, if you're having trouble with merges or finding them messy (as I do), you can rebase in the future: the new GitHub UI now preserves review comments at the right line numbers.
https://github.com/llvm/llvm-project/pull/161276
    
    
More information about the llvm-commits
mailing list