[llvm] r228587 - Clarify the wording on what it means for a SCEVAddRecExpr to be <NW>.

Sanjoy Das sanjoy at playingwithpointers.com
Mon Feb 9 10:44:42 PST 2015


Author: sanjoy
Date: Mon Feb  9 12:44:42 2015
New Revision: 228587

URL: http://llvm.org/viewvc/llvm-project?rev=228587&view=rev
Log:
Clarify the wording on what it means for a SCEVAddRecExpr to be <NW>.


Modified:
    llvm/trunk/include/llvm/Analysis/ScalarEvolution.h

Modified: llvm/trunk/include/llvm/Analysis/ScalarEvolution.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/ScalarEvolution.h?rev=228587&r1=228586&r2=228587&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/ScalarEvolution.h (original)
+++ llvm/trunk/include/llvm/Analysis/ScalarEvolution.h Mon Feb  9 12:44:42 2015
@@ -82,12 +82,12 @@ namespace llvm {
     /// operator. NSW is a misnomer that we use to mean no signed overflow or
     /// underflow.
     ///
-    /// AddRec expression may have a no-self-wraparound <NW> property if the
-    /// result can never reach the start value. This property is independent of
-    /// the actual start value and step direction. Self-wraparound is defined
-    /// purely in terms of the recurrence's loop, step size, and
-    /// bitwidth. Formally, a recurrence with no self-wraparound satisfies:
-    /// abs(step) * max-iteration(loop) <= unsigned-max(bitwidth).
+    /// AddRec expressions may have a no-self-wraparound <NW> property if, in
+    /// the integer domain, abs(step) * max-iteration(loop) <=
+    /// unsigned-max(bitwidth).  This means that the recurrence will never reach
+    /// its start value if the step is non-zero.  Computing the same value on
+    /// each iteration is not considered wrapping, and recurrences with step = 0
+    /// are trivially <NW>.
     ///
     /// Note that NUW and NSW are also valid properties of a recurrence, and
     /// either implies NW. For convenience, NW will be set for a recurrence





More information about the llvm-commits mailing list