some comment improvements.
authorChris Lattner <sabre@nondot.org>
Tue, 11 Jan 2011 17:11:59 +0000 (17:11 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 11 Jan 2011 17:11:59 +0000 (17:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123243 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp

index 4706c09e7916c0ee31a9aa77f3c70f968aa80c4a..d1938061bef6958a462ab726f603680594bd62d6 100644 (file)
@@ -537,8 +537,9 @@ namespace llvm {
     ///
     const SCEV *getNotSCEV(const SCEV *V);
 
-    /// getMinusSCEV - Return LHS-RHS.
-    ///
+    /// getMinusSCEV - Return LHS-RHS.  Minus is represented in SCEV as A+B*-1,
+    /// and thus the HasNUW and HasNSW bits apply to the resultant add, not
+    /// whether the sub would have overflowed.
     const SCEV *getMinusSCEV(const SCEV *LHS, const SCEV *RHS,
                              bool HasNUW = false, bool HasNSW = false);
 
index ead43721c367d955b9c351807c09c9fc055999b3..b3df92611950e895a03e5d0d876098b4992fc335 100644 (file)
@@ -2446,8 +2446,9 @@ const SCEV *ScalarEvolution::getNotSCEV(const SCEV *V) {
   return getMinusSCEV(AllOnes, V);
 }
 
-/// getMinusSCEV - Return a SCEV corresponding to LHS - RHS.
-///
+/// getMinusSCEV - Return LHS-RHS.  Minus is represented in SCEV as A+B*-1,
+/// and thus the HasNUW and HasNSW bits apply to the resultant add, not
+/// whether the sub would have overflowed.
 const SCEV *ScalarEvolution::getMinusSCEV(const SCEV *LHS, const SCEV *RHS,
                                           bool HasNUW, bool HasNSW) {
   // Fast path: X - X --> 0.
@@ -4021,7 +4022,7 @@ static const SCEV *getMinusSCEVForExitTest(const SCEV *LHS, const SCEV *RHS,
     cast<SCEVConstant>(RHSA->getOperand(1))->getValue();
   
   // If the strides are equal, then this is just a (complex) loop invariant
-  // comparison of a/b.
+  // comparison of a and b.
   if (LHSStride == RHSStride)
     return SE.getMinusSCEV(LHSA->getStart(), RHSA->getStart());